From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 36BDA15802F for ; Mon, 6 Mar 2023 20:41:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5EED5E086F; Mon, 6 Mar 2023 20:41:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 40753E086F for ; Mon, 6 Mar 2023 20:41:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ED1FC340955 for ; Mon, 6 Mar 2023 20:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 301FF531 for ; Mon, 6 Mar 2023 20:41:07 +0000 (UTC) From: "Ionen Wolkens" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" Message-ID: <1678135190.b88415abf5a1a3174a30fb6bdf4cdca8cb8a6ab7.ionen@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/mpv/files/, media-video/mpv/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch media-video/mpv/mpv-0.35.1-r1.ebuild media-video/mpv/mpv-0.35.1.ebuild X-VCS-Directories: media-video/mpv/files/ media-video/mpv/ X-VCS-Committer: ionen X-VCS-Committer-Name: Ionen Wolkens X-VCS-Revision: b88415abf5a1a3174a30fb6bdf4cdca8cb8a6ab7 X-VCS-Branch: master Date: Mon, 6 Mar 2023 20:41:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4a24b321-c73b-4f28-8f4e-2ec76eb65aa6 X-Archives-Hash: cc67350c10343bfe745f81ff93a62fa6 commit: b88415abf5a1a3174a30fb6bdf4cdca8cb8a6ab7 Author: Ionen Wolkens gentoo org> AuthorDate: Mon Mar 6 20:35:40 2023 +0000 Commit: Ionen Wolkens gentoo org> CommitDate: Mon Mar 6 20:39:50 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b88415ab media-video/mpv: backport ytdl hook fix for dash videos Feels safe enough for straight-to-stable given only touches the lua script which is already semi-broken. Closes: https://bugs.gentoo.org/899956 Signed-off-by: Ionen Wolkens gentoo.org> .../files/mpv-0.35.1-yt-dlp-edl-fragments.patch | 55 ++++++++++++++++++++++ .../{mpv-0.35.1.ebuild => mpv-0.35.1-r1.ebuild} | 4 ++ 2 files changed, 59 insertions(+) diff --git a/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch b/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch new file mode 100644 index 000000000000..058c608233d4 --- /dev/null +++ b/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch @@ -0,0 +1,55 @@ +https://bugs.gentoo.org/899956 +https://github.com/mpv-player/mpv/pull/11398 + +From 985655ebfd77ceddc44d76f8cc6dc446002f34ee Mon Sep 17 00:00:00 2001 +From: Christoph Heinrich +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. +--- 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 +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. +--- 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/media-video/mpv/mpv-0.35.1.ebuild b/media-video/mpv/mpv-0.35.1-r1.ebuild similarity index 99% rename from media-video/mpv/mpv-0.35.1.ebuild rename to media-video/mpv/mpv-0.35.1-r1.ebuild index 5ea6dc240af6..9d2d6ee62ae3 100644 --- a/media-video/mpv/mpv-0.35.1.ebuild +++ b/media-video/mpv/mpv-0.35.1-r1.ebuild @@ -133,6 +133,10 @@ BDEPEND=" cli? ( dev-python/docutils ) wayland? ( dev-util/wayland-scanner )" +PATCHES=( + "${FILESDIR}"/${P}-yt-dlp-edl-fragments.patch +) + pkg_setup() { use lua && lua-single_pkg_setup python-single-r1_pkg_setup