Skip to content

Commit

Permalink
make codec user settings override what device reports
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Aug 31, 2023
1 parent c03a1b1 commit 8dd2c55
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions source/utils/deviceCapabilities.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8dd2c55

Please sign in to comment.