From f321d8da991177ffaa8842ef4a05ea2714265f28 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 20 Feb 2020 14:55:14 +0100 Subject: ytdl_hook: signal duration in all_formats mode If all streams were delay loaded, there was actually no duration present at all in the EDL metadata. So the length was considered unknown by the player frontend. --- player/lua/ytdl_hook.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 0215ad024e..687f765865 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -378,6 +378,7 @@ local function formats_to_edl(json, formats, use_all_formats) local url = edl_track or track.url local hdr = {"!new_stream", "!no_clip", "!no_chapters"} local as_muxed = false + local params = "" if use_all_formats then if interlaved_streams then @@ -407,10 +408,14 @@ local function formats_to_edl(json, formats, use_all_formats) edl_escape(track.format_note or "") .. ",byterate=" .. byterate separate_present[media_type] = true + + if duration > 0 then + params = params .. ",length=" .. duration + end end end - hdr[#hdr + 1] = edl_escape(url) + hdr[#hdr + 1] = edl_escape(url) .. params if as_muxed then muxed_present = true -- cgit v1.2.3