forked from j62/ctbrec
Try to terminate FFmpeg before killing it
This commit is contained in:
parent
d7d3e2944b
commit
f0713b96f5
|
@ -412,9 +412,12 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
|
||||||
try {
|
try {
|
||||||
boolean waitFor = ffmpeg.waitFor(45, TimeUnit.SECONDS);
|
boolean waitFor = ffmpeg.waitFor(45, TimeUnit.SECONDS);
|
||||||
if (!waitFor && ffmpeg.isAlive()) {
|
if (!waitFor && ffmpeg.isAlive()) {
|
||||||
LOG.info("FFmpeg didn't terminate. Destroying the process with force!");
|
ffmpeg.destroy();
|
||||||
ffmpeg.destroyForcibly();
|
if (ffmpeg.isAlive()) {
|
||||||
ffmpeg = null;
|
LOG.info("FFmpeg didn't terminate. Destroying the process with force!");
|
||||||
|
ffmpeg.destroyForcibly();
|
||||||
|
ffmpeg = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LOG.error("Interrupted while waiting for FFmpeg to terminate");
|
LOG.error("Interrupted while waiting for FFmpeg to terminate");
|
||||||
|
|
Loading…
Reference in New Issue