Merge pull request #260 from neilsb/static-analyser-fixes

Fixed Static analyser issues
This commit is contained in:
Anthony Lavado 2020-07-23 19:21:06 -07:00 committed by GitHub
commit e51dc44358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 33 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -229,26 +229,8 @@ function decodeAudioSupported(meta as object) as boolean
codec = meta.json.MediaStreams[1].codec
streamInfo = { Codec: codec, ChCnt: meta.json.MediaStreams[1].channels }
'Check for Passthrough
audioDecoders = devinfo.GetAudioDecodeInfo()
'DTS
if (codec = "dts" or codec = "dca") and audioDecoders.doesexist("dts") then
return true
end if
'DD
if codec = "ac3" and audioDecoders.doesexist("ac3") then
return true
end if
'DD+
if codec = "eac3" and audioDecoders.doesexist("DD+") then
return true
end if
'Otherwise check Roku can decode stream and channels
canDecode = devinfo.CanDecodeVideo(streamInfo)
canDecode = devinfo.CanDecodeAudio(streamInfo)
return canDecode.result
end function

View File

@ -155,53 +155,51 @@ function GetDirectPlayProfiles() as object
end if
' Check for supported Audio
audioDecoders = di.GetAudioDecodeInfo()
if audioDecoders.doesexist("AC3") then
if di.CanDecodeAudio({ Codec: "ac3"}).result then
mkvAudio = mkvAudio + ",ac3"
mp4Audio = mp4Audio + ",ac3"
audio = audio + ",ac3"
end if
if audioDecoders.doesexist("WMA") then
if di.CanDecodeAudio({ Codec: "wma"}).result then
audio = audio + ",wma"
end if
if audioDecoders.doesexist("FLAC") then
if di.CanDecodeAudio({ Codec: "flac"}).result then
mkvAudio = mkvAudio + ",flac"
audio = audio + ",flac"
end if
if audioDecoders.doesexist("ALAC") then
if di.CanDecodeAudio({ Codec: "alac"}).result then
mkvAudio = mkvAudio + ",alac"
mp4Audio = mp4Audio + ",alac"
audio = audio + ",alac"
end if
if audioDecoders.doesexist("AAC") then
if di.CanDecodeAudio({ Codec: "aac"}).result then
mkvAudio = mkvAudio + ",aac"
mp4Audio = mp4Audio + ",aac"
audio = audio + ",aac"
end if
if audioDecoders.doesexist("OPUS") then
if di.CanDecodeAudio({ Codec: "opus"}).result then
mkvAudio = mkvAudio + ",opus"
end if
if audioDecoders.doesexist("DTS") then
mkvAudio = mkvAudio + ",dts,dca"
audio = audio + ",dts,dca"
if di.CanDecodeAudio({ Codec: "dts"}).result then
mkvAudio = mkvAudio + ",dts"
audio = audio + ",dts"
end if
if audioDecoders.doesexist("WMAPRO") then
if di.CanDecodeAudio({ Codec: "wmapro"}).result then
audio = audio + ",wmapro"
end if
if audioDecoders.doesexist("VORBIS") then
if di.CanDecodeAudio({ Codec: "vorbis"}).result then
mkvAudio = mkvAudio + ",vorbis"
end if
if audioDecoders.doesexist("DD+") then
if di.CanDecodeAudio({ Codec: "eac3"}).result then
mkvAudio = mkvAudio + ",eac3"
end if