aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2025-02-03 16:55:55 -0500
committerBond_009 <bond.009@outlook.com>2025-02-03 16:55:55 -0500
commitb79f96e98bdedef354c56ab2389cbcd8c8035d88 (patch)
tree362065374fb2cb18ccb082260025df8d2c44b7b8 /Jellyfin.Api/Helpers
parentf46cb112f7bd78a6dc8f458403244867761f3499 (diff)
Backport pull request #13169 from jellyfin/release-10.10.z
Check if the video has an audio track before codec fallback Original-merge: ff4f3b04411833dd7675be870dde9212394acf95 Merged-by: Bond-009 <bond.009@outlook.com> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'Jellyfin.Api/Helpers')
-rw-r--r--Jellyfin.Api/Helpers/StreamingHelpers.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs
index c4c3a992f..2601fa3be 100644
--- a/Jellyfin.Api/Helpers/StreamingHelpers.cs
+++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs
@@ -236,7 +236,7 @@ public static class StreamingHelpers
}
}
- if (!EncodingHelper.IsCopyCodec(state.OutputAudioCodec) && string.Equals(state.AudioStream.Codec, state.OutputAudioCodec, StringComparison.OrdinalIgnoreCase) && state.OutputAudioBitrate.HasValue)
+ if (state.AudioStream is not null && !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);
}