aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/DynamicHlsController.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-01-12 09:49:29 +0100
committerGitHub <noreply@github.com>2023-01-12 09:49:29 +0100
commit3a7a781ed99b278dda931daaddb8a5e947a2ff69 (patch)
tree3b46fb07d97e32e14e8eaa154a59eb71cb2ec1ab /Jellyfin.Api/Controllers/DynamicHlsController.cs
parent81c8890b6d0f8b84dd52264d6c43e04dc130c79d (diff)
parent407c716f82da25fa5ffe30a819ea1adb5c6873ab (diff)
Merge pull request #9001 from Shadowghost/stereo-downmix
Fixes https://github.com/jellyfin/jellyfin/issues/1986
Diffstat (limited to 'Jellyfin.Api/Controllers/DynamicHlsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 5f5f34b0d..ba9a57f1d 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -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;
}