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

ytdl_hook: init fragment requires other fragments

With dash the first fragment was always considered an init fragment if
there wasn't a duration. However that only makes sense when there are
also other fragments, so check if there are other fragments in addition
to the lack of a duration.
This commit is contained in:
Christoph Heinrich 2023-03-03 00:45:45 +01:00 committed by Dudemanguy
parent 296d40dc6f
commit 94c189dae7

View File

@ -297,7 +297,7 @@ local function edl_track_joined(fragments, protocol, is_live, base)
local args = ""
-- assume MP4 DASH initialization segment
if not fragments[1].duration then
if not fragments[1].duration and #fragments > 1 then
msg.debug("Using init segment")
args = args .. ",init=" .. edl_escape(join_url(base, fragments[1]))
offset = 2