Check videoRotation in video stream copy

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
nyanmisaka
2026-05-09 15:11:04 +08:00
parent 5cb6ac521a
commit fc251265d9
3 changed files with 41 additions and 36 deletions

View File

@@ -2466,6 +2466,17 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
var requestedRotations = state.GetRequestedRotations(videoStream.Codec);
if (requestedRotations.Length > 0)
{
var rotation = state.VideoStream?.Rotation ?? 0;
if (rotation != 0
&& !requestedRotations.Contains(rotation.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal))
{
return false;
}
}
// Video width must fall within requested value
if (request.MaxWidth.HasValue
&& (!videoStream.Width.HasValue || videoStream.Width.Value > request.MaxWidth.Value))