Merge pull request #7947 from nyanmisaka/video-range-condition

(cherry picked from commit f1d56aa5ce)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
Cody Robibero
2022-06-17 10:01:06 -06:00
committed by Joshua Boniface
parent 7f1223016d
commit 38102499cb
14 changed files with 190 additions and 30 deletions

View File

@@ -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))