Merge pull request #247 from neilsb/no-audio-videos

Handle videos with no audio track
This commit is contained in:
Anthony Lavado 2020-07-15 00:09:13 -04:00 committed by GitHub
commit 14fcee4a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ function VideoContent(video) as object
end function
function getTranscodeParameters(meta as object)
if decodeAudioSupported(meta) then
if decodeAudioSupported(meta) and meta.json.MediaStreams[1] <> invalid and meta.json.MediaStreams[1].Type = "Audio" then
audioCodec = meta.json.MediaStreams[1].codec
audioChannels = meta.json.MediaStreams[1].channels
else
@ -221,6 +221,10 @@ function directPlaySupported(meta as object) as boolean
end function
function decodeAudioSupported(meta as object) as boolean
'Check for missing audio and allow playing
if meta.json.MediaStreams[1] = invalid or meta.json.MediaStreams[1].Type <> "Audio" then return true
devinfo = CreateObject("roDeviceInfo")
codec = meta.json.MediaStreams[1].codec
streamInfo = { Codec: codec, ChCnt: meta.json.MediaStreams[1].channels }