aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dlna
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Dlna')
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs36
-rw-r--r--MediaBrowser.Model/Dlna/TranscodingProfile.cs1
2 files changed, 26 insertions, 11 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 59f97d8c7c..ab8d5dd5b2 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -576,11 +576,8 @@ namespace MediaBrowser.Model.Dlna
foreach (var profile in subtitleProfiles)
{
if (profile.Method == SubtitleDeliveryMethod.External
- && (string.Equals(profile.Format, stream.Codec, StringComparison.OrdinalIgnoreCase)
- // FFmpeg cannot mux VobSub back into an .idx/.sub pair, so extracted VobSub streams are exposed as .mks.
- || (string.Equals(profile.Format, "mks", StringComparison.OrdinalIgnoreCase)
- && stream.IsVobSubSubtitleStream
- && (!stream.IsExternal || stream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase)))))
+ && (IsVobSubMksProfile(profile, stream)
+ || (!IsVobSubMksDeliveryProfile(profile) && string.Equals(profile.Format, stream.Codec, StringComparison.OrdinalIgnoreCase))))
{
return stream.Index;
}
@@ -1585,18 +1582,20 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (!subtitleStream.IsExternal && playMethod == PlayMethod.Transcode && !transcoderSupport.CanExtractSubtitles(subtitleStream.Codec))
+ if (!subtitleStream.IsExternal
+ && playMethod == PlayMethod.Transcode
+ && !transcoderSupport.CanExtractSubtitles(subtitleStream.Codec)
+ && !subtitleStream.IsPgsSubtitleStream
+ && !subtitleStream.IsVobSubSubtitleStream)
{
continue;
}
- // FFmpeg cannot mux VobSub back into an .idx/.sub pair, so extracted VobSub streams are matched against external .mks delivery profiles.
- bool isVobSubMksProfile = string.Equals(profile.Format, "mks", StringComparison.OrdinalIgnoreCase)
- && subtitleStream.IsVobSubSubtitleStream
- && (!subtitleStream.IsExternal || subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase));
+ bool isVobSubMksProfile = IsVobSubMksProfile(profile, subtitleStream);
if ((profile.Method == SubtitleDeliveryMethod.External
- && (isVobSubMksProfile || subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))) ||
+ && (isVobSubMksProfile
+ || (!IsVobSubMksDeliveryProfile(profile) && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format)))) ||
(profile.Method == SubtitleDeliveryMethod.Hls && subtitleStream.IsTextSubtitleStream))
{
bool requiresConversion = !isVobSubMksProfile
@@ -1628,6 +1627,21 @@ namespace MediaBrowser.Model.Dlna
return null;
}
+ private static bool IsVobSubMksDeliveryProfile(SubtitleProfile profile)
+ {
+ return MediaStream.IsVobSubFormat(profile.Format)
+ && !string.IsNullOrWhiteSpace(profile.Container)
+ && ContainerHelper.ContainsContainer(profile.Container, "mks");
+ }
+
+ private static bool IsVobSubMksProfile(SubtitleProfile profile, MediaStream subtitleStream)
+ {
+ // FFmpeg cannot mux VobSub back into an .idx/.sub pair, so extracted VobSub streams are exposed as .mks.
+ return IsVobSubMksDeliveryProfile(profile)
+ && subtitleStream.IsVobSubSubtitleStream
+ && (!subtitleStream.IsExternal || subtitleStream.Path?.EndsWith(".mks", StringComparison.OrdinalIgnoreCase) == true);
+ }
+
private bool IsBitrateLimitExceeded(MediaSourceInfo item, long maxBitrate)
{
// Don't restrict bitrate if item is remote.
diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
index f49b24976a..b5adee173b 100644
--- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs
+++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
@@ -141,6 +141,7 @@ public class TranscodingProfile
/// Gets or sets a value indicating whether breaking the video stream on non-keyframes is supported.
/// </summary>
[DefaultValue(false)]
+ [XmlIgnore]
[XmlAttribute("breakOnNonKeyFrames")]
[Obsolete("This is always false")]
public bool? BreakOnNonKeyFrames { get; set; }