check audio stream for null
This commit is contained in:
parent
9b0e289602
commit
e208ef19b0
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
return SplitValue(Container);
|
||||
}
|
||||
|
||||
private static List<string> SplitValue(string value)
|
||||
public static List<string> SplitValue(string value)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
foreach (string i in (value ?? string.Empty).Split(','))
|
||||
|
|
|
@ -1231,21 +1231,27 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
private static bool IsSubtitleEmbedSupported(MediaStream subtitleStream, SubtitleProfile subtitleProfile, string transcodingSubProtocol, string transcodingContainer)
|
||||
{
|
||||
if (string.Equals(transcodingContainer, "ts", StringComparison.OrdinalIgnoreCase))
|
||||
if (!string.IsNullOrWhiteSpace(transcodingContainer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (string.Equals(transcodingContainer, "mpegts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (string.Equals(transcodingContainer, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (string.Equals(transcodingContainer, "mkv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
var normalizedContainers = ContainerProfile.SplitValue(transcodingContainer);
|
||||
|
||||
if (ContainerProfile.ContainsContainer(normalizedContainers, "ts"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ContainerProfile.ContainsContainer(normalizedContainers, "mpegts"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ContainerProfile.ContainsContainer(normalizedContainers, "mp4"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv") ||
|
||||
ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1572,14 +1578,17 @@ namespace MediaBrowser.Model.Dlna
|
|||
}
|
||||
|
||||
// Check audio codec
|
||||
List<string> audioCodecs = profile.GetAudioCodecs();
|
||||
if (audioCodecs.Count > 0)
|
||||
if (audioStream != null)
|
||||
{
|
||||
// Check audio codecs
|
||||
string audioCodec = audioStream == null ? null : audioStream.Codec;
|
||||
if (string.IsNullOrEmpty(audioCodec) || !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
|
||||
List<string> audioCodecs = profile.GetAudioCodecs();
|
||||
if (audioCodecs.Count > 0)
|
||||
{
|
||||
return false;
|
||||
// Check audio codecs
|
||||
string audioCodec = audioStream == null ? null : audioStream.Codec;
|
||||
if (string.IsNullOrEmpty(audioCodec) || !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user