diff options
| author | gnattu <gnattuoc@me.com> | 2024-04-22 06:19:17 +0800 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2024-07-17 13:35:59 +0800 |
| commit | e4101128e011c089bad46a524856438154cfbd3d (patch) | |
| tree | d49b2adf8e17ff61c57f495e013093bc9674cb68 /Jellyfin.Api/Helpers | |
| parent | c050abf3e848a3dc0968b18baaee5d0ffb54b334 (diff) | |
feat: add audio remux to UniversalAudioController
Signed-off-by: gnattu <gnattuoc@me.com>
Diffstat (limited to 'Jellyfin.Api/Helpers')
| -rw-r--r-- | Jellyfin.Api/Helpers/DynamicHlsHelper.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/DynamicHlsHelper.cs b/Jellyfin.Api/Helpers/DynamicHlsHelper.cs index f8d89119a..8df4caea5 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)) |
