forked from j62/ctbrec
1
0
Fork 0

Fix NPE in internalStop

This commit is contained in:
0xboobface 2020-05-10 10:43:37 +02:00
parent cd5172613e
commit 3c4ef05a48
1 changed files with 11 additions and 9 deletions

View File

@ -358,16 +358,18 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
} }
} }
try { if (ffmpeg != null) {
boolean waitFor = ffmpeg.waitFor(5, TimeUnit.MINUTES); try {
if (!waitFor && ffmpeg.isAlive()) { boolean waitFor = ffmpeg.waitFor(5, TimeUnit.MINUTES);
LOG.info("FFmpeg didn't terminate. Destroying the process with force!"); if (!waitFor && ffmpeg.isAlive()) {
ffmpeg.destroyForcibly(); LOG.info("FFmpeg didn't terminate. Destroying the process with force!");
ffmpeg = null; ffmpeg.destroyForcibly();
ffmpeg = null;
}
} catch (InterruptedException e) {
LOG.error("Interrupted while waiting for FFmpeg to terminate");
Thread.currentThread().interrupt();
} }
} catch (InterruptedException e) {
LOG.error("Interrupted while waiting for FFmpeg to terminate");
Thread.currentThread().interrupt();
} }
} }