瀏覽代碼

Set AudioCodec when building stream

This was not set at least since 10.9 and the transcoding behavior is close to "undefined" and in 10.10 this will not work at all. This will make the returned transcoding url from PlayBackInfo to correctly specify the desired transcoding codec. If the client wants to use the HLS controller directly it should be responsible to provide valid container and codec in the parameters.
gnattu 7 月之前
父節點
當前提交
b0f44f1d5a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      MediaBrowser.Model/Dlna/StreamBuilder.cs

+ 4 - 0
MediaBrowser.Model/Dlna/StreamBuilder.cs

@@ -208,6 +208,10 @@ namespace MediaBrowser.Model.Dlna
 
 
                 var longBitrate = Math.Min(transcodingBitrate, playlistItem.AudioBitrate ?? transcodingBitrate);
                 var longBitrate = Math.Min(transcodingBitrate, playlistItem.AudioBitrate ?? transcodingBitrate);
                 playlistItem.AudioBitrate = longBitrate > int.MaxValue ? int.MaxValue : Convert.ToInt32(longBitrate);
                 playlistItem.AudioBitrate = longBitrate > int.MaxValue ? int.MaxValue : Convert.ToInt32(longBitrate);
+                if (playlistItem.AudioCodecs.Count == 0 && !string.IsNullOrWhiteSpace(transcodingProfile.AudioCodec))
+                {
+                    playlistItem.AudioCodecs = [transcodingProfile.AudioCodec];
+                }
             }
             }
 
 
             playlistItem.TranscodeReasons = transcodeReasons;
             playlistItem.TranscodeReasons = transcodeReasons;