aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/DynamicHlsController.cs
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-04-23 00:23:36 +0800
committerGitHub <noreply@github.com>2024-04-22 10:23:36 -0600
commit374b6ca0e22719df25b8d0aa51c510515b928104 (patch)
tree586c2d8276b15a2d22115f4f0abd52df355df421 /Jellyfin.Api/Controllers/DynamicHlsController.cs
parent09b02296700e8a2affa17555062516206e543f7c (diff)
Only apply custom downmix to 5.1 audios (#11401)
Diffstat (limited to 'Jellyfin.Api/Controllers/DynamicHlsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 49fc2f3d7..24edd7958 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -1712,12 +1712,11 @@ public class DynamicHlsController : BaseJellyfinApiController
var channels = state.OutputAudioChannels;
+ var useDownMixAlgorithm = state.AudioStream.Channels is 6 && _encodingOptions.DownMixStereoAlgorithm != DownMixStereoAlgorithms.None;
+
if (channels.HasValue
&& (channels.Value != 2
- || (state.AudioStream is not null
- && state.AudioStream.Channels.HasValue
- && state.AudioStream.Channels.Value > 5
- && _encodingOptions.DownMixStereoAlgorithm == DownMixStereoAlgorithms.None)))
+ || (state.AudioStream?.Channels != null && !useDownMixAlgorithm)))
{
args += " -ac " + channels.Value;
}