From 4ca76733b0c079b51c7c81159af2621a6221f427 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:31:39 -0400 Subject: [PATCH] Don't directplay AAC if profile is main. Transcode to AC3 Fixes #36 --- source/utils/deviceCapabilities.bs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/source/utils/deviceCapabilities.bs b/source/utils/deviceCapabilities.bs index 5e47058d6..8d39946d9 100644 --- a/source/utils/deviceCapabilities.bs +++ b/source/utils/deviceCapabilities.bs @@ -1,5 +1,5 @@ -import "pkg:/source/utils/misc.bs" import "pkg:/source/api/baserequest.bs" +import "pkg:/source/utils/misc.bs" ' Returns the Device Capabilities for Roku. function getDeviceCapabilities() as object @@ -138,7 +138,7 @@ function GetDirectPlayProfiles() as object ' remove audio codecs not supported as standalone audio files (opus) ' also add aac back to the list so it gets added to the direct play profile - audioCodecs = ["aac", "mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "dts", "wmapro", "vorbis", "eac3", "mpg123"] + audioCodecs = ["mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "dts", "wmapro", "vorbis", "eac3", "mpg123"] ' check audio codecs with no container supportedAudio = [] @@ -184,9 +184,9 @@ function getTranscodingProfiles() as object transcodingContainers = ["mp4", "ts"] ' use strings to preserve order - mp4AudioCodecs = "aac" + mp4AudioCodecs = "AC3" mp4VideoCodecs = "h264" - tsAudioCodecs = "aac" + tsAudioCodecs = "AC3" tsVideoCodecs = "h264" ' does the users setup support surround sound? @@ -439,6 +439,25 @@ function getCodecProfiles() as object for each codecType in ["VideoAudio", "Audio"] if audioCodec = "opus" and codecType = "Audio" ' opus audio files not supported by roku + else if audioCodec = "aac" + codecProfiles.push({ + "Type": codecType, + "Codec": audioCodec, + "Conditions": [ + { + "Condition": "LessThanEqual", + "Property": "AudioChannels", + "Value": audioChannel, + "IsRequired": true + }, + { + "Condition": "NotEquals", + "Property": "AudioProfile", + "Value": "Main", + "IsRequired": true + } + ] + }) else codecProfiles.push({ "Type": codecType,