aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornyanmisaka <nst799610810@gmail.com>2020-12-24 19:41:02 +0800
committernyanmisaka <nst799610810@gmail.com>2020-12-24 19:41:02 +0800
commitbc6ec08322a6d9111849dd4661bdda3746347835 (patch)
treecf24af03dfa89de742e24e6b8b49f4fe4ead944b
parentafdc98746b4dab23b2647d303ba5ac95f0846f46 (diff)
avoid transcoding to 3ch audio for HLS streaming
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 6667c1c3b..17201551a 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -1722,6 +1722,16 @@ namespace MediaBrowser.Controller.MediaEncoding
: transcoderChannelLimit.Value;
}
+ // Avoid transcoding to audio channels other than 1ch, 2ch, 6ch (5.1 layout) and 8ch (7.1 layout).
+ // https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices
+ if (isTranscodingAudio
+ && resultChannels.HasValue
+ && resultChannels.Value > 2
+ && resultChannels.Value < 6)
+ {
+ resultChannels = 2;
+ }
+
return resultChannels;
}