Only apply custom downmix to 5.1 audios (#11401)

This commit is contained in:
gnattu
2024-04-23 00:23:36 +08:00
committed by GitHub
parent 09b0229670
commit 374b6ca0e2
3 changed files with 22 additions and 11 deletions

View File

@@ -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;
}