From 9a4ac228a4739b36195442d12ac8b12dc0325329 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Sun, 20 Oct 2024 19:08:21 -0400 Subject: [PATCH] always transcode multichannel aac if surround sound is detected --- source/api/Items.bs | 11 +++++++++++ source/utils/deviceCapabilities.bs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/api/Items.bs b/source/api/Items.bs index 05262bece..7381b32fe 100644 --- a/source/api/Items.bs +++ b/source/api/Items.bs @@ -81,6 +81,17 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT end if end if end for + + ' don't direct play multi-channel AAC + if selectedAudioStream.Codec <> invalid and LCase(selectedAudioStream.Codec) = "aac" + for each container in deviceProfile.DirectPlayProfiles + if container.AudioCodec = "aac" + container.AudioCodec = "" + else if container.AudioCodec.Left(4) = "aac," + container.AudioCodec = mid(container.AudioCodec, 5) + end if + end for + end if end if end if diff --git a/source/utils/deviceCapabilities.bs b/source/utils/deviceCapabilities.bs index 384838972..44065db66 100644 --- a/source/utils/deviceCapabilities.bs +++ b/source/utils/deviceCapabilities.bs @@ -87,7 +87,7 @@ function GetDirectPlayProfiles() as object } ' all possible codecs (besides those restricted by user settings) videoCodecs = ["h264", "mpeg4 avc", "vp8", "vp9", "h263", "mpeg1"] - audioCodecs = ["mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "opus", "dts", "wmapro", "vorbis", "eac3", "mpg123"] + audioCodecs = ["aac", "mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "opus", "dts", "wmapro", "vorbis", "eac3", "mpg123"] ' check if hevc is disabled if globalUserSettings["playback.compatibility.disablehevc"] = false