mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 05:30:46 +02:00
normalize subtitle names
This commit is contained in:
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…
Reference in a new issue