diff --git a/components/ItemGrid/LoadVideoContentTask.brs b/components/ItemGrid/LoadVideoContentTask.brs index 31c10e3e7..736198a18 100644 --- a/components/ItemGrid/LoadVideoContentTask.brs +++ b/components/ItemGrid/LoadVideoContentTask.brs @@ -229,10 +229,16 @@ sub addVideoContentURL(video, mediaSourceId, audio_stream_idx, fully_external) print "Users receiver can not decode the selected multichannel audio stream" ' check to see if the receiver can decode our preferred audio codec preferredCodec = "ac3" - if m.global.session.user.settings["playback.forceDTS"] - if selectedAudioStream.Container = "webm" or selectedAudioStream = "mkv" + forceMKV = false + if selectedAudioStream.Container = "webm" or selectedAudioStream = "mkv" + if m.global.session.user.settings["playback.forceDTS"] preferredCodec = "dts" end if + else + ' if the file is aac and not mkv, force container to be mkv + if selectedAudioStream.Codec = "aac" + forceMKV = true + end if end if if di.CanDecodeAudio({ Codec: preferredCodec, ChCnt: selectedAudioStream.Channels, PassThru: 1 }).Result print "Attempting to transcode audio to our preferred multichannel codec" @@ -240,6 +246,9 @@ sub addVideoContentURL(video, mediaSourceId, audio_stream_idx, fully_external) ' otherwise the roku device will downmix aac/opus to stereo params.Delete("Static") params.audioCodec = preferredCodec + if forceMKV + params.container = "mkv" + end if video.isTranscoded = true video.directplaysupported = false params.transcodeReasons = "Switching audio codecs to preserve multichannel audio support"