aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Model/Dlna/ContainerProfile.cs2
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs49
2 files changed, 30 insertions, 21 deletions
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index a8f203e22..c05c19412 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -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(','))
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index b483d527c..1be0b40a5 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -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;
+ }
}
}