From 38102499cb21cae8cd177ebc6b98037b3bc3f620 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Fri, 17 Jun 2022 10:01:06 -0600 Subject: Merge pull request #7947 from nyanmisaka/video-range-condition (cherry picked from commit f1d56aa5cef4c60021e0b29c5d9fb3adf384fda7) Signed-off-by: Joshua Boniface --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs') diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 04778e699..d5b0aca3c 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1753,6 +1753,20 @@ namespace MediaBrowser.Controller.MediaEncoding } } + var requestedRangeTypes = state.GetRequestedRangeTypes(videoStream.Codec); + if (requestedProfiles.Length > 0) + { + if (string.IsNullOrEmpty(videoStream.VideoRangeType)) + { + return false; + } + + if (!requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase)) + { + return false; + } + } + // Video width must fall within requested value if (request.MaxWidth.HasValue && (!videoStream.Width.HasValue || videoStream.Width.Value > request.MaxWidth.Value)) -- cgit v1.2.3