From b7f6ccc306404c6d825ea80b0e084e5c482247dc Mon Sep 17 00:00:00 2001 From: gnattu Date: Sat, 30 Nov 2024 17:59:39 -0500 Subject: [PATCH] Backport pull request #13113 from jellyfin/release-10.10.z Only do DoVi remux when the client supports profiles without fallbacks Original-merge: 9464f9e62266266bcec2a97f88fcc988aa4976a6 Merged-by: Bond-009 Backported-by: Bond_009 --- Jellyfin.Api/Controllers/DynamicHlsController.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs index 54e0527c90..a641ec2091 100644 --- a/Jellyfin.Api/Controllers/DynamicHlsController.cs +++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs @@ -1819,16 +1819,13 @@ public class DynamicHlsController : BaseJellyfinApiController if (isActualOutputVideoCodecHevc || isActualOutputVideoCodecAv1) { var requestedRange = state.GetRequestedRangeTypes(state.ActualOutputVideoCodec); - var requestHasDOVI = requestedRange.Contains(VideoRangeType.DOVI.ToString(), StringComparison.OrdinalIgnoreCase); - var requestHasDOVIWithHDR10 = requestedRange.Contains(VideoRangeType.DOVIWithHDR10.ToString(), StringComparison.OrdinalIgnoreCase); - var requestHasDOVIWithHLG = requestedRange.Contains(VideoRangeType.DOVIWithHLG.ToString(), StringComparison.OrdinalIgnoreCase); - var requestHasDOVIWithSDR = requestedRange.Contains(VideoRangeType.DOVIWithSDR.ToString(), StringComparison.OrdinalIgnoreCase); + // Clients reporting Dolby Vision capabilities with fallbacks may only support the fallback layer. + // Only enable Dolby Vision remuxing if the client explicitly declares support for profiles without fallbacks. + var clientSupportsDoVi = requestedRange.Contains(VideoRangeType.DOVI.ToString(), StringComparison.OrdinalIgnoreCase); + var videoIsDoVi = state.VideoStream.VideoRangeType is VideoRangeType.DOVI or VideoRangeType.DOVIWithHDR10 or VideoRangeType.DOVIWithHLG or VideoRangeType.DOVIWithSDR; if (EncodingHelper.IsCopyCodec(codec) - && ((state.VideoStream.VideoRangeType == VideoRangeType.DOVI && requestHasDOVI) - || (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithHDR10 && requestHasDOVIWithHDR10) - || (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithHLG && requestHasDOVIWithHLG) - || (state.VideoStream.VideoRangeType == VideoRangeType.DOVIWithSDR && requestHasDOVIWithSDR))) + && (videoIsDoVi && clientSupportsDoVi)) { if (isActualOutputVideoCodecHevc) {