Skip to content

Commit

Permalink
force aac 5.1 to use mkv when preserving multichannel audio
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Oct 2, 2023
1 parent 0de0071 commit c4b7dbf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/ItemGrid/LoadVideoContentTask.brs
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,26 @@ 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"
' transcode the audio to keep multichannel support
' 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"
Expand Down

0 comments on commit c4b7dbf

Please sign in to comment.