ytdl_hook: use fallback if there's no demuxer-lavf-list prop

This is important if backporting by grabbing the latest version of
the script without backporting the commit that added the property:

828bd2963c
This commit is contained in:
Ricardo Constantino 2018-02-11 13:16:45 +00:00 committed by Kevin Mitchell
parent 40f29a33df
commit 268431c858
No known key found for this signature in database
GPG Key ID: 559A34B46A917232
1 changed files with 3 additions and 3 deletions

View File

@ -215,8 +215,8 @@ local function edl_track_joined(fragments, protocol, is_live, base)
end
local function has_native_dash_demuxer()
local demuxers = mp.get_property_native("demuxer-lavf-list")
for _,v in ipairs(demuxers) do
local demuxers = mp.get_property_native("demuxer-lavf-list", {})
for _, v in ipairs(demuxers) do
if v == "dash" then
return true
end
@ -230,7 +230,7 @@ local function valid_manifest(json)
return false
end
local proto = reqfmt["protocol"] or json["protocol"] or ""
return (has_native_dash_demuxer() and proto == "http_dash_segments") or
return (proto == "http_dash_segments" and has_native_dash_demuxer()) or
proto:find("^m3u8")
end