aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2025-12-03 14:04:18 -0500
committerBond_009 <bond.009@outlook.com>2025-12-03 14:04:18 -0500
commit8cd6ef37c4a4220ddca502beb61e979767d49344 (patch)
treedc03a2f2ca46d1462e34a7b75040e995e33bdce7 /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
parente4daaf0d8330ab1e8abadcb927b03b5ded08895a (diff)
Backport pull request #15556 from jellyfin/release-10.11.z
Prevent copying HDR streams when only SDR is supported Original-merge: 1e7e46cb8212385f86564b92d111ad80464f45d0 Merged-by: crobibero <cody@robibe.ro> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index a1d891535..915c787f2 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -2378,6 +2378,13 @@ namespace MediaBrowser.Controller.MediaEncoding
var requestHasSDR = requestedRangeTypes.Contains(VideoRangeType.SDR.ToString(), StringComparison.OrdinalIgnoreCase);
var requestHasDOVI = requestedRangeTypes.Contains(VideoRangeType.DOVI.ToString(), StringComparison.OrdinalIgnoreCase);
+ // If SDR is the only supported range, we should not copy any of the HDR streams.
+ // All the following copy check assumes at least one HDR format is supported.
+ if (requestedRangeTypes.Length == 1 && requestHasSDR && videoStream.VideoRangeType != VideoRangeType.SDR)
+ {
+ return false;
+ }
+
// If the client does not support DOVI and the video stream is DOVI without fallback, we should not copy it.
if (!requestHasDOVI && videoStream.VideoRangeType == VideoRangeType.DOVI)
{