Skip to content

Commit

Permalink
ytdl_hook: use fallback if there's no demuxer-lavf-list prop
Browse files Browse the repository at this point in the history
This is important if backporting by grabbing the latest version of
the script without backporting the commit that added the property:

828bd29
  • Loading branch information
wiiaboo authored and kevmitch committed Feb 12, 2018
1 parent 40f29a3 commit 268431c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions player/lua/ytdl_hook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 268431c

Please sign in to comment.