diff options
| author | Cody Robibero <cody@robibe.ro> | 2022-06-17 10:01:06 -0600 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2022-06-29 01:26:14 -0400 |
| commit | 38102499cb21cae8cd177ebc6b98037b3bc3f620 (patch) | |
| tree | 3dcf9745d4c57d8a5ee89f6e75516ed9fc24586c /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | 7f1223016df0c9b55d89992b612648ed35a636dc (diff) | |
Merge pull request #7947 from nyanmisaka/video-range-condition
(cherry picked from commit f1d56aa5cef4c60021e0b29c5d9fb3adf384fda7)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 14 |
1 files changed, 14 insertions, 0 deletions
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)) |
