summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-01-05 14:34:31 +0100
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitd23336089c905c0ab2efa6c36f70b50e1694a420 (patch)
tree9a3f5f0448597afaede502e791d3f96d39619358
parent80d2016075083c0183d83dacc25627fd4cc3a1de (diff)
downloadmpv-d23336089c905c0ab2efa6c36f70b50e1694a420.tar.bz2
mpv-d23336089c905c0ab2efa6c36f70b50e1694a420.tar.xz
ytdl_hook: fix pseudo-DASH if no init fragment is present
Init fragments are not a necessity for DASH, but this code assumed so. Maybe the check was to prevent worse. But using normal EDL here leads to very shitty behavior where it tries to open hundreds or thousands of fragments, each with its own demuxer and HTTP connection. (This behavior is fine for normal uses of EDLs, but completely unacceptable when emulating fragmented streaming protocols. I'm not sure why the normal EDL code is needed here, but I think someone claimed some obscure sites just need it.) This happens in the same situation as the one described in the previous commit.
-rw-r--r--player/lua/ytdl_hook.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index a6b9456001..82381b88c3 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -222,12 +222,18 @@ local function edl_track_joined(fragments, protocol, is_live, base)
local offset = 1
local parts = {}
- if (protocol == "http_dash_segments") and
- not fragments[1].duration and not is_live then
+ if (protocol == "http_dash_segments") and not is_live then
+ msg.debug("Using dash")
+ local args = ""
+
-- assume MP4 DASH initialization segment
- table.insert(parts,
- "!mp4_dash,init=" .. edl_escape(join_url(base, fragments[1])))
- offset = 2
+ if not fragments[1].duration then
+ msg.debug("Using init segment")
+ args = args .. ",init=" .. edl_escape(join_url(base, fragments[1]))
+ offset = 2
+ end
+
+ table.insert(parts, "!mp4_dash" .. args)
-- Check remaining fragments for duration;
-- if not available in all, give up.