0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00

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.
This commit is contained in:
wm4 2020-02-20 14:55:14 +01:00
parent 89203cc994
commit f321d8da99

View File

@ -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