jellyfin/MediaBrowser.Model/MediaInfo/AudioCodec.cs

30 lines
757 B
C#
Raw Normal View History

namespace MediaBrowser.Model.MediaInfo
2018-12-27 16:27:57 -07:00
{
public class AudioCodec
{
public const string AAC = "aac";
public const string MP3 = "mp3";
public const string AC3 = "ac3";
public static string GetFriendlyName(string codec)
{
2019-01-27 04:03:43 -07:00
if (string.IsNullOrEmpty(codec))
{
return string.Empty;
}
2018-12-27 16:27:57 -07:00
2019-01-27 04:03:43 -07:00
switch (codec.ToLowerInvariant())
2018-12-27 16:27:57 -07:00
{
case "ac3":
return "Dolby Digital";
case "eac3":
return "Dolby Digital+";
case "dca":
return "DTS";
default:
2019-01-27 04:03:43 -07:00
return codec.ToUpperInvariant();
2018-12-27 16:27:57 -07:00
}
}
}
}