aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2025-02-03 16:54:36 -0500
committerBond_009 <bond.009@outlook.com>2025-02-03 16:54:36 -0500
commit39cd3dcbd11c8e0ef58a9ba4bbb3c9bfccd6950f (patch)
treee0ad611dff1529085abbd36d3f53d53b8e45431c /Jellyfin.Api
parent51207edf44c4ec74a621a3ea9c5b9ee55c006009 (diff)
Backport pull request #13127 from jellyfin/release-10.10.z
Fallback to lossy audio codec for bitrate limit Original-merge: 65f722f23c781d6346741589a681b8b00579fc8a Merged-by: crobibero <cody@robibe.ro> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'Jellyfin.Api')
-rw-r--r--Jellyfin.Api/Helpers/StreamingHelpers.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs
index 1923393cb..c4c3a992f 100644
--- a/Jellyfin.Api/Helpers/StreamingHelpers.cs
+++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs
@@ -235,6 +235,11 @@ public static class StreamingHelpers
state.VideoRequest.MaxHeight = resolution.MaxHeight;
}
}
+
+ if (!EncodingHelper.IsCopyCodec(state.OutputAudioCodec) && string.Equals(state.AudioStream.Codec, state.OutputAudioCodec, StringComparison.OrdinalIgnoreCase) && state.OutputAudioBitrate.HasValue)
+ {
+ state.OutputAudioCodec = state.SupportedAudioCodecs.Where(c => !EncodingHelper.LosslessAudioCodecs.Contains(c)).FirstOrDefault(mediaEncoder.CanEncodeToAudioCodec);
+ }
}
var ext = string.IsNullOrWhiteSpace(state.OutputContainer)