summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-20 14:55:14 +0100
committerwm4 <wm4@nowhere>2020-02-20 14:55:14 +0100
commitf321d8da991177ffaa8842ef4a05ea2714265f28 (patch)
treec1d65dde8dd345aa5a506bb89de3d42736756eaf
parent89203cc994bb0f2009f8553f611da67486330cd2 (diff)
downloadmpv-f321d8da991177ffaa8842ef4a05ea2714265f28.tar.bz2
mpv-f321d8da991177ffaa8842ef4a05ea2714265f28.tar.xz
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.
-rw-r--r--player/lua/ytdl_hook.lua7
1 files changed, 6 insertions, 1 deletions
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