From 71a708cdb851d1e91332b261b706e15cfc4bcf23 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sun, 22 Jan 2023 14:06:19 -0500 Subject: [PATCH] Backport pull request #9092 from jellyfin/release-10.8.z Don't add additional entries if HEVC encoding is disabled Original-merge: 2a5efeb3bb5938b614cb159868e98d56487040c9 Merged-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> Backported-by: Joshua M. Boniface --- Jellyfin.Api/Helpers/DynamicHlsHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Api/Helpers/DynamicHlsHelper.cs b/Jellyfin.Api/Helpers/DynamicHlsHelper.cs index 010b181f70..1310801c58 100644 --- a/Jellyfin.Api/Helpers/DynamicHlsHelper.cs +++ b/Jellyfin.Api/Helpers/DynamicHlsHelper.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Jellyfin.Api.Extensions; using Jellyfin.Api.Models.StreamingDtos; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; @@ -203,9 +204,11 @@ namespace Jellyfin.Api.Helpers { builder.Append(flacWaPlaylist); } + var encodingOptions = _serverConfigurationManager.GetEncodingOptions(); // Provide SDR HEVC entrance for backward compatibility. - if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec) + if (encodingOptions.AllowHevcEncoding + && EncodingHelper.IsCopyCodec(state.OutputVideoCodec) && !string.IsNullOrEmpty(state.VideoStream.VideoRange) && string.Equals(state.VideoStream.VideoRange, "HDR", StringComparison.OrdinalIgnoreCase) && string.Equals(state.ActualOutputVideoCodec, "hevc", StringComparison.OrdinalIgnoreCase))