normalize subtitle names

pull/702/head
Luke Pulverenti 8 years ago
parent 6798a8f92c
commit 5ca29f0fba

@ -393,6 +393,20 @@ namespace MediaBrowser.MediaEncoding.Probing
}; };
} }
private string NormalizeSubtitleCodec(string codec)
{
if ((codec ?? string.Empty).IndexOf("PGS", StringComparison.OrdinalIgnoreCase) != -1)
{
codec = "PGSSUB";
}
else if ((codec ?? string.Empty).IndexOf("DVD", StringComparison.OrdinalIgnoreCase) != -1)
{
codec = "DVDSUB";
}
return codec;
}
/// <summary> /// <summary>
/// Converts ffprobe stream info to our MediaStream class /// Converts ffprobe stream info to our MediaStream class
/// </summary> /// </summary>
@ -474,6 +488,7 @@ namespace MediaBrowser.MediaEncoding.Probing
else if (string.Equals(streamInfo.codec_type, "subtitle", StringComparison.OrdinalIgnoreCase)) else if (string.Equals(streamInfo.codec_type, "subtitle", StringComparison.OrdinalIgnoreCase))
{ {
stream.Type = MediaStreamType.Subtitle; stream.Type = MediaStreamType.Subtitle;
stream.Codec = NormalizeSubtitleCodec(stream.Codec);
} }
else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase)) else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase))
{ {

Loading…
Cancel
Save