public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Maxwell G <maxwell@gtmx.me>
To: git-commits@fedoraproject.org
Subject: [rpms/mpv] epel9-next: Backport upstream patch to fix yt-dlp hook
Date: Mon, 20 Jul 2026 19:36:07 GMT	[thread overview]
Message-ID: <178457616778.1.16316342690553841364.rpms-mpv-53c8dc10d43e@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/mpv
            Branch : epel9-next
            Commit : 53c8dc10d43e9499a5f95fd96236155740072eea
            Author : Maxwell G <maxwell@gtmx.me>
            Date   : 2023-03-06T19:18:14-06:00
            Stats  : +69/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/mpv/c/53c8dc10d43e9499a5f95fd96236155740072eea?branch=epel9-next

            Log:
            Backport upstream patch to fix yt-dlp hook

This restores compatibility with the latest yt-dlp release. I'm blocking
the yt-dlp update on this fix [1].

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-4e472e2c77#comment-2934829

---
diff --git a/fix-yt-dlp-hook.patch b/fix-yt-dlp-hook.patch
new file mode 100644
index 0000000..81792de
--- /dev/null
+++ b/fix-yt-dlp-hook.patch
@@ -0,0 +1,64 @@
+From 985655ebfd77ceddc44d76f8cc6dc446002f34ee Mon Sep 17 00:00:00 2001
+From: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
+Date: Fri, 3 Mar 2023 00:45:45 +0100
+Subject: [PATCH 1/2] 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 27e5f4544b2..9e50b3a80b8 100644
+--- a/player/lua/ytdl_hook.lua
++++ b/player/lua/ytdl_hook.lua
+@@ -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
+
+From a5961ad096b1361a12f836c8b170fc748f46962a Mon Sep 17 00:00:00 2001
+From: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
+Date: Fri, 3 Mar 2023 00:50:58 +0100
+Subject: [PATCH 2/2] ytdl_hook: only log error when no fallback url available
+
+An error indicates that something doesn't work, but as long as a
+safe url is available, playback is still expected to work.
+
+Thus reduce logging level of MP4 DASH without fragments message and
+add a new error message for when there is no safe url available either.
+
+Also adds a missing space.
+---
+ player/lua/ytdl_hook.lua | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
+index 9e50b3a80b8..77f7446ed22 100644
+--- a/player/lua/ytdl_hook.lua
++++ b/player/lua/ytdl_hook.lua
+@@ -309,7 +309,7 @@ local function edl_track_joined(fragments, protocol, is_live, base)
+         -- if not available in all, give up.
+         for i = offset, #fragments do
+             if not fragments[i].duration then
+-                msg.error("EDL doesn't support fragments" ..
++                msg.verbose("EDL doesn't support fragments " ..
+                          "without duration with MP4 DASH")
+                 return nil
+             end
+@@ -423,6 +423,7 @@ local function formats_to_edl(json, formats, use_all_formats)
+             track.protocol, json.is_live,
+             track.fragment_base_url)
+         if not edl_track and not url_is_safe(track.url) then
++            msg.error("No safe URL or supported fragmented stream available")
+             return nil
+         end
+ 

diff --git a/mpv.spec b/mpv.spec
index aa4660b..1943055 100644
--- a/mpv.spec
+++ b/mpv.spec
@@ -1,11 +1,12 @@
 Name:           mpv
 Version:        0.35.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 
 License:        GPL-2.0-or-later AND LGPL-2.1-or-later
 Summary:        Movie player playing most video formats and DVDs
 URL:            https://%{name}.io/
 Source0:        https://github.com/%{name}-player/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
+Patch:          https://github.com/mpv-player/mpv/pull/11398.patch#/fix-yt-dlp-hook.patch
 
 BuildRequires:  desktop-file-utils
 BuildRequires:  gcc
@@ -175,6 +176,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Tue Mar 07 2023 Maxwell G <maxwell@gtmx.me> - 0.35.1-2
+- Backport upstream patch to fix yt-dlp hook
+
 * Mon Jan 30 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 0.35.1-1
 - Updated to version 0.35.1.
 

                 reply	other threads:[~2026-07-20 19:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178457616778.1.16316342690553841364.rpms-mpv-53c8dc10d43e@fedoraproject.org \
    --to=maxwell@gtmx.me \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox