فهرست منبع

Check if the video has an audio track before fallback

This would break transcoding for videos without an audio track as the codec checking would be null referencing.
gnattu 6 ماه پیش
والد
کامیت
cd4519c15f
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Jellyfin.Api/Helpers/StreamingHelpers.cs

+ 1 - 1
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);
             }