Skip to content

Commit

Permalink
fix for #54: Output pattern without extension causes ffmpeg crash
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekmotyl committed Apr 10, 2022
1 parent e54c40f commit 96aaf68
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SimpleVideoCutter/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,13 @@ private void EnqeueNewTask()
var outputDir = ReplaceStandardDirectoryPatterns(VideoCutterSettings.Instance.OutputDirectory);
var outputFileName = ReplaceFilePatterns(VideoCutterSettings.Instance.OutputFilePattern, fileBeingPlayed);
var outputFilePath = Path.Combine(outputDir, outputFileName);
var fileExtension = Path.GetExtension(outputFilePath);

var knownExtension = VideoCutterSettings.Instance.VideoFilesExtensions.Any(ext => ext.ToLower() == fileExtension.ToLower());
if (!knownExtension || string.IsNullOrEmpty(Path.GetExtension(outputFilePath)))
{
outputFilePath += Path.GetExtension(fileBeingPlayed);
}

var selections = videoCutterTimeline1.Selections.AllSelections.Select(s => new FFmpegTaskSelection()
{
Expand Down

0 comments on commit 96aaf68

Please sign in to comment.