From 8dd2c55df27e3015212a02d3acbfb16d7e9fe6cb Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Wed, 30 Aug 2023 22:51:47 -0400 Subject: [PATCH] make codec user settings override what device reports --- source/utils/deviceCapabilities.brs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/source/utils/deviceCapabilities.brs b/source/utils/deviceCapabilities.brs index e0d4280d..7c1821e9 100644 --- a/source/utils/deviceCapabilities.brs +++ b/source/utils/deviceCapabilities.brs @@ -776,16 +776,8 @@ function GetDirectPlayProfiles() as object } } ' all possible codecs - videoCodecs = ["h264", "mpeg4 avc", "vp8", "hevc", "vp9", "av1"] + videoCodecs = ["h264", "mpeg4 avc", "vp8", "hevc", "vp9", "av1", "mpeg4", "mpeg2"] audioCodecs = ["mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "opus", "dts", "wmapro", "vorbis", "eac3"] - ' respect user settings - if m.global.session.user.settings["playback.mpeg4"] - videoCodecs.push("mpeg4") - end if - if m.global.session.user.settings["playback.mpeg2"] - videoCodecs.push("mpeg2") - end if - ' check video codecs for each container for each container in supportedCodecs for each videoCodec in videoCodecs @@ -802,6 +794,21 @@ function GetDirectPlayProfiles() as object end if end for end for + ' user settings override what the device thinks + if m.global.session.user.settings["playback.mpeg4"] + for each container in supportedCodecs + if supportedCodecs[container]["video"]["mpeg4"] = invalid + supportedCodecs[container]["video"].push("mpeg4") + end if + end for + end if + if m.global.session.user.settings["playback.mpeg2"] + for each container in supportedCodecs + if supportedCodecs[container]["video"]["mpeg2video"] = invalid + supportedCodecs[container]["video"].push("mpeg2video") + end if + end for + end if ' check audio codecs for each container for each container in supportedCodecs