diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 5c900a1..7ffa608 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -6,7 +6,7 @@ pkgname=mpv epoch=1 _tag='5ae02ccad10542a74b397e39800ec01def0db4e1' # git rev-parse v${pkgver} pkgver=0.35.1 -pkgrel=3 +pkgrel=4 pkgdesc='a free, open source, and cross-platform media player' arch=('x86_64') # We link against libraries that are licensed GPLv3 explicitly, so our @@ -30,8 +30,14 @@ optdepends=('yt-dlp: for video-sharing websites playback' provides=('libmpv.so') options=('!emptydirs') validpgpkeys=('145077D82501AA20152CACCE8D769208D5E31419') # sfan5 -source=("git+https://github.com/mpv-player/mpv.git#tag=${_tag}?signed") -sha256sums=('SKIP') +source=("git+https://github.com/mpv-player/mpv.git#tag=${_tag}?signed" + bug-77950-pr-11398.patch) +sha256sums=('SKIP' + '41b34b8e4659875cb54abd65e2d984375689d5dac20b7b604a6586f58f90ac76') + +prepare() { + patch -d "$pkgname" -p 1 < bug-77950-pr-11398.patch +} build() { diff --git a/trunk/bug-77950-pr-11398.patch b/trunk/bug-77950-pr-11398.patch new file mode 100644 index 0000000..81792de --- /dev/null +++ b/trunk/bug-77950-pr-11398.patch @@ -0,0 +1,64 @@ +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. +--- + 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 +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 +