diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 690505869..3718edba4 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1759,6 +1759,13 @@ namespace MediaBrowser.Api.Playback videoRequest.EnableSplittingOnNonKeyFrames = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } } + else if (i == 30) + { + if (videoRequest != null) + { + videoRequest.RequireAvc = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); + } + } } } @@ -2115,7 +2122,7 @@ namespace MediaBrowser.Api.Playback if (string.Equals("h264", videoStream.Codec, StringComparison.OrdinalIgnoreCase)) { - if (videoStream.IsAVC.HasValue && !videoStream.IsAVC.Value) + if (videoStream.IsAVC.HasValue && !videoStream.IsAVC.Value && request.RequireAvc) { Logger.Debug("Cannot stream copy video. Stream is marked as not AVC"); return false; diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 625818d29..50c779765 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -195,6 +195,7 @@ namespace MediaBrowser.Api.Playback public bool EnableSubtitlesInManifest { get; set; } public bool EnableSplittingOnNonKeyFrames { get; set; } + public bool RequireAvc { get; set; } public VideoStreamRequest() { diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index c11cfb523..71f0fd541 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -1055,6 +1055,22 @@ namespace MediaBrowser.Model.Dlna } break; } + case ProfileConditionValue.IsAvc: + { + bool isAvc; + if (bool.TryParse(value, out isAvc)) + { + if (isAvc && condition.Condition == ProfileConditionType.Equals) + { + item.RequireAvc = true; + } + else if (!isAvc && condition.Condition == ProfileConditionType.NotEquals) + { + item.RequireAvc = true; + } + } + break; + } case ProfileConditionValue.IsAnamorphic: case ProfileConditionValue.AudioProfile: case ProfileConditionValue.Has64BitOffsets: @@ -1135,6 +1151,8 @@ namespace MediaBrowser.Model.Dlna } break; } + default: + break; } } } diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index b8db8a10c..e5dd0353e 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -35,6 +35,7 @@ namespace MediaBrowser.Model.Dlna public string VideoCodec { get; set; } public string VideoProfile { get; set; } + public bool RequireAvc { get; set; } public bool CopyTimestamps { get; set; } public bool EnableSubtitlesInManifest { get; set; } public bool EnableSplittingOnNonKeyFrames { get; set; } @@ -266,6 +267,7 @@ namespace MediaBrowser.Model.Dlna list.Add(new NameValuePair("Tag", item.MediaSource.ETag ?? string.Empty)); list.Add(new NameValuePair("EnableSplittingOnNonKeyFrames", item.EnableSplittingOnNonKeyFrames.ToString().ToLower())); + list.Add(new NameValuePair("RequireAvc", item.RequireAvc.ToString().ToLower())); return list; }