File: 0003-ytdl_hook-init-fragment-requires-other-fragments.patch

package info (click to toggle)
mpv 0.35.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,520 kB
  • sloc: ansic: 140,768; objc: 3,426; python: 2,842; sh: 750; javascript: 592; ruby: 113; pascal: 49; xml: 29; makefile: 20
file content (25 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
Date: Fri, 3 Mar 2023 00:45:45 +0100
Subject: 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.
---
 player/lua/ytdl_hook.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index f40579a..faaff8c 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -295,7 +295,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