forked from j62/ctbrec
1
0
Fork 0

Fix "rerun pp" for MFC dash downloads

This commit is contained in:
0xboobface 2019-12-21 18:59:31 +01:00
parent 6fb1ee5153
commit 2fb2c932aa
3 changed files with 9 additions and 3 deletions

View File

@ -415,7 +415,8 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
MenuItem rerunPostProcessing = new MenuItem("Rerun Post-Processing");
rerunPostProcessing.setOnAction(e -> triggerPostProcessing(first));
if ((first.getStatus() == State.FINISHED || first.getStatus() == State.WAITING) && first.isSegmented()) {
if (((first.getStatus() == State.FINISHED || first.getStatus() == State.WAITING) && first.isSegmented())
|| first.getStatus() == State.WAITING && first.isSegmented()) {
contextMenu.getItems().add(rerunPostProcessing);
}

View File

@ -334,9 +334,11 @@ public class DashDownload implements Download {
@Override
public void postprocess(Recording recording) {
try {
new FfmpegMuxer(downloadDir.toFile(), finalFile);
targetFile = finalFile;
String path = recording.getPath();
File dir = new File(Config.getInstance().getSettings().recordingsDir, path);
File file = new File(dir.getParentFile(), dir.getName().substring(0, dir.getName().length() - 5));
new FfmpegMuxer(dir, file);
targetFile = file;
recording.setPath(path.substring(0, path.length() - 5));
} catch (ProcessExitedUncleanException | IOException e) {
LOG.error("Error while merging dash segments", e);

View File

@ -324,6 +324,9 @@ public class MyFreeCamsModel extends AbstractModel {
@Override
public Download createDownload() {
if(streamUrl == null) {
updateStreamUrl();
}
if(streamUrl.endsWith("m3u8")) {
return super.createDownload();
} else {