Merge pull request #9001 from Shadowghost/stereo-downmix

Fixes https://github.com/jellyfin/jellyfin/issues/1986
This commit is contained in:
Bond-009
2023-01-12 09:49:29 +01:00
committed by GitHub
4 changed files with 292 additions and 130 deletions

View File

@@ -22,6 +22,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using Microsoft.AspNetCore.Authorization;
@@ -1732,7 +1733,12 @@ namespace Jellyfin.Api.Controllers
var channels = state.OutputAudioChannels;
if (channels.HasValue)
if (channels.HasValue
&& (channels.Value != 2
|| (state.AudioStream is not null
&& state.AudioStream.Channels.HasValue
&& state.AudioStream.Channels.Value > 5
&& _encodingOptions.DownMixStereoAlgorithm == DownMixStereoAlgorithms.None)))
{
args += " -ac " + channels.Value;
}