Merge pull request #7960 from Shadowghost/subrip-encoder-fix

(cherry picked from commit ae79bbc34c)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
Joshua M. Boniface
2022-06-20 09:57:57 -04:00
committed by Joshua Boniface
parent c0e4a33a0b
commit e61c80fed7
4 changed files with 122 additions and 1 deletions

View File

@@ -283,6 +283,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
private bool TryGetWriter(string format, [NotNullWhen(true)] out ISubtitleWriter? value)
{
if (string.Equals(format, SubtitleFormat.ASS, StringComparison.OrdinalIgnoreCase))
{
value = new AssWriter();
return true;
}
if (string.IsNullOrEmpty(format))
{
throw new ArgumentNullException(nameof(format));
@@ -294,12 +300,18 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return true;
}
if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase))
if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase) || string.Equals(format,SubtitleFormat.SUBRIP, StringComparison.OrdinalIgnoreCase))
{
value = new SrtWriter();
return true;
}
if (string.Equals(format, SubtitleFormat.SSA, StringComparison.OrdinalIgnoreCase))
{
value = new SsaWriter();
return true;
}
if (string.Equals(format, SubtitleFormat.VTT, StringComparison.OrdinalIgnoreCase))
{
value = new VttWriter();