summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-30 19:38:43 +0100
committerwm4 <wm4@nowhere>2017-02-04 22:34:38 +0100
commit61202bb3640740d2cb98cf13922dcdf67970d5ef (patch)
tree2318d52589ada16859f19761924a26aa7bd09812 /player
parent97680bf6041a0512c929c927024b38235a35ce55 (diff)
downloadmpv-61202bb3640740d2cb98cf13922dcdf67970d5ef.tar.bz2
mpv-61202bb3640740d2cb98cf13922dcdf67970d5ef.tar.xz
ytdl_hook, edl: implement pseudo-DASH support
We use the metadata provided by youtube-dl to sort-of implement fragmented DASH streaming. This is all a bit hacky, but hopefully a makeshift solution until libavformat has proper mechanisms. (Although in danger of being one of those temporary hacks that become permanent.)
Diffstat (limited to 'player')
-rw-r--r--player/lua/ytdl_hook.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 7349e579e3..fba5100822 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -90,11 +90,17 @@ end
local function edl_track_joined(fragments)
local edl = "edl://"
- for i = 1, #fragments do
+ local offset = 1
+ if fragments[1] and not fragments[1].duration then
+ -- if no duration, probably initialization segment
+ edl = edl .. "!mp4_dash,init=" .. edl_escape(fragments[1].url)
+ offset = 2
+ end
+ for i = offset, #fragments do
local fragment = fragments[i]
- edl = edl .. edl_escape(fragment.url)
if fragment.duration then
- edl = edl .. ",length=" .. fragment.duration
+ edl = edl .. edl_escape(fragment.url)
+ edl = edl..",length="..fragment.duration
end
edl = edl .. ";"
end