Fixed single quotes escape in subtitle file path

This commit is contained in:
alex6dj 2021-10-03 11:07:15 -04:00
parent e6e07fc2fe
commit 975bd75c5d
2 changed files with 7 additions and 7 deletions

View file

@ -353,10 +353,10 @@ public void Builder_BuildString_SubtitleHardBurnFilterFixedPaths()
.OutputToFile("output.mp4", false, opt => opt
.WithVideoFilters(filterOptions => filterOptions
.HardBurnSubtitle(SubtitleHardBurnOptions
.Create(subtitlePath: @"sample( \ : [ ] , ).srt"))))
.Create(subtitlePath: @"sample( \ : [ ] , ' ).srt"))))
.Arguments;
Assert.AreEqual(@"-i ""input.mp4"" -vf ""subtitles='sample( \\ \: \[ \] \, ).srt'"" ""output.mp4""",
Assert.AreEqual(@"-i ""input.mp4"" -vf ""subtitles='sample( \\ \: \[ \] \, '\\\'' ).srt'"" ""output.mp4""",
str);
}

View file

@ -11,7 +11,7 @@ internal static class StringExtensions
{ ':', @"\:" },
{ '[', @"\[" },
{ ']', @"\]" },
// {'\'', @"\'"} TODO: Quotes need to be escaped but i failed miserably
{ '\'', @"'\\\''" }
};
/// <summary>