Skip to content

Commit

Permalink
Properly escape file names in ffmpeg's concat arguments.
Browse files Browse the repository at this point in the history
Closes #96. Also closes #75, which seems to be the result of the same problem.
  • Loading branch information
fflewddur committed Jun 25, 2016
1 parent da81344 commit 2188de4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net/straylightlabs/archivo/controller/ArchiveTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ private void cutCommercials() {
logger.info("splitList: {}", splitList);
List<FFSplitList.Segment> toKeep = splitList.getSegmentsToKeep();
int curSegment = 1;
Path escapedPath = Paths.get(fixedPath.toString().replace("\'", ""));
for (FFSplitList.Segment segment : toKeep) {
List<String> cmd = new ArrayList<>();
cmd.add(ffmpegPath);
Expand All @@ -536,8 +535,9 @@ private void cutCommercials() {
cmd.add("copy");
cmd.addAll(segment.buildFFmpegOutputParamList());

Path partPath = buildPath(escapedPath, String.format("part%02d.ts", filePartCounter++));
writer.println(String.format("file '%s'", partPath.toString().replace("'", "\\'")));
Path partPath = buildPath(fixedPath, String.format("part%02d.ts", filePartCounter++));
logger.debug("partPath = '{}'", partPath);
writer.println(String.format("file '%s'", partPath.toString().replace("\'", "\'\\\'\'")));
partPaths.add(partPath);
cmd.add(partPath.toString());

Expand Down

0 comments on commit 2188de4

Please sign in to comment.