Skip to content

Commit

Permalink
dont include container when checking device for av1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Sep 27, 2023
1 parent 698720f commit 2830347
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions source/utils/deviceCapabilities.brs
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,16 @@ function getDeviceProfile() as object
end if

' AV1
addAv1 = di.CanDecodeVideo({ Codec: "av1" }).Result
av1Profiles = ["main", "main 10"]
av1Levels = ["4.1", "5.0", "5.1"]
addAv1 = false
if playAv1

if playAv1 and addAv1
for each container in profileSupport
for each profile in av1Profiles
for each level in av1Levels
if di.CanDecodeVideo({ Codec: "av1", Container: container, Profile: profile, Level: level }).Result
addAv1 = true
' av1 doesn't support checking for container
if di.CanDecodeVideo({ Codec: "av1", Profile: profile, Level: level }).Result
profileSupport[container] = updateProfileArray(profileSupport[container], "av1", profile, level)
if container = "mp4"
' check for codec string before adding it
Expand Down Expand Up @@ -602,7 +603,7 @@ function getDeviceProfile() as object
deviceProfile.CodecProfiles.push(codecProfileArray)
end if

if addAv1
if playAv1 and addAv1
av1Mp4LevelSupported = 0.0
av1TsLevelSupported = 0.0
av1AssProfiles = []
Expand Down Expand Up @@ -833,11 +834,6 @@ function GetDirectPlayProfiles() as object
videoCodecs = ["h264", "mpeg4 avc", "vp8", "vp9", "h263", "mpeg1"]
audioCodecs = ["mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "opus", "dts", "wmapro", "vorbis", "eac3", "mpg123"]

' only try to direct play av1 if asked
if m.global.session.user.settings["playback.av1"]
videoCodecs.push("av1")
end if

' check if hevc is disabled
if m.global.session.user.settings["playback.compatibility.disablehevc"] = false
videoCodecs.push("hevc")
Expand Down Expand Up @@ -870,6 +866,15 @@ function GetDirectPlayProfiles() as object
end for
end if

' video codec overrides
' these codecs play fine but are not correctly detected using CanDecodeVideo()
if m.global.session.user.settings["playback.av1"] and di.CanDecodeVideo({ Codec: "av1" }).Result
' codec must be checked by itself or the result will always be false
for each container in supportedCodecs
supportedCodecs[container]["video"].push("av1")
end for
end if

' check audio codecs for each container
for each container in supportedCodecs
for each audioCodec in audioCodecs
Expand Down

0 comments on commit 2830347

Please sign in to comment.