Improve exception handling
Change exception handling so that failed post-processing causes the recording to have the state "failed"
This commit is contained in:
parent
fde24e80ea
commit
f91a0d27eb
|
@ -30,9 +30,9 @@ import org.slf4j.LoggerFactory;
|
||||||
import ctbrec.Config;
|
import ctbrec.Config;
|
||||||
import ctbrec.Model;
|
import ctbrec.Model;
|
||||||
import ctbrec.Recording;
|
import ctbrec.Recording;
|
||||||
|
import ctbrec.Recording.State;
|
||||||
import ctbrec.io.HttpClient;
|
import ctbrec.io.HttpClient;
|
||||||
import ctbrec.recorder.download.Download;
|
import ctbrec.recorder.download.Download;
|
||||||
import ctbrec.recorder.download.dash.FfmpegMuxer.ProcessExitedUncleanException;
|
|
||||||
import ctbrec.recorder.download.dash.SegmentTimelineType.S;
|
import ctbrec.recorder.download.dash.SegmentTimelineType.S;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
@ -340,8 +340,9 @@ public class DashDownload implements Download {
|
||||||
new FfmpegMuxer(dir, file);
|
new FfmpegMuxer(dir, file);
|
||||||
targetFile = file;
|
targetFile = file;
|
||||||
recording.setPath(path.substring(0, path.length() - 5));
|
recording.setPath(path.substring(0, path.length() - 5));
|
||||||
} catch (ProcessExitedUncleanException | IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Error while merging dash segments", e);
|
LOG.error("Error while merging dash segments", e);
|
||||||
|
recording.setStatus(State.FAILED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue