aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/DynamicHlsHelper.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2024-07-18 08:12:20 -0400
committerGitHub <noreply@github.com>2024-07-18 08:12:20 -0400
commit4239de1ee78ee5e739c926918fca75f2ced8c1b4 (patch)
treee7574543c5f500b9ca30199a6241bd5aaf44e819 /Jellyfin.Api/Helpers/DynamicHlsHelper.cs
parent5262439300884680b1425b94de9c2f9c898d83ae (diff)
parent59c18a7454074b3c2b7c67e0dc4071e3ffc5d704 (diff)
Merge pull request #11399 from jellyfin/audio-remux
Diffstat (limited to 'Jellyfin.Api/Helpers/DynamicHlsHelper.cs')
-rw-r--r--Jellyfin.Api/Helpers/DynamicHlsHelper.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/DynamicHlsHelper.cs b/Jellyfin.Api/Helpers/DynamicHlsHelper.cs
index b3878a41e..6f040cfae 100644
--- a/Jellyfin.Api/Helpers/DynamicHlsHelper.cs
+++ b/Jellyfin.Api/Helpers/DynamicHlsHelper.cs
@@ -151,6 +151,14 @@ public class DynamicHlsHelper
var queryString = _httpContextAccessor.HttpContext.Request.QueryString.ToString();
+ // from universal audio service, need to override the AudioCodec when the actual request differs from original query
+ if (!string.Equals(state.OutputAudioCodec, _httpContextAccessor.HttpContext.Request.Query["AudioCodec"].ToString(), StringComparison.OrdinalIgnoreCase))
+ {
+ var newQuery = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(_httpContextAccessor.HttpContext.Request.QueryString.ToString());
+ newQuery["AudioCodec"] = state.OutputAudioCodec;
+ queryString = Microsoft.AspNetCore.WebUtilities.QueryHelpers.AddQueryString(string.Empty, newQuery);
+ }
+
// from universal audio service
if (!string.IsNullOrWhiteSpace(state.Request.SegmentContainer)
&& !queryString.Contains("SegmentContainer", StringComparison.OrdinalIgnoreCase))