Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package baka-mplayer for openSUSE:Factory checked in at 2022-02-26 17:02:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/baka-mplayer (Old) and /work/SRC/openSUSE:Factory/.baka-mplayer.new.1958 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "baka-mplayer" Sat Feb 26 17:02:16 2022 rev:5 rq:957734 version:2.0.4 Changes: -------- --- /work/SRC/openSUSE:Factory/baka-mplayer/baka-mplayer.changes 2019-11-09 23:23:15.591770942 +0100 +++ /work/SRC/openSUSE:Factory/.baka-mplayer.new.1958/baka-mplayer.changes 2022-02-26 17:02:50.731543169 +0100 @@ -1,0 +2,6 @@ +Mon Feb 21 11:01:48 UTC 2022 - Fusion Future <qydwhotm...@gmail.com> + +- Fix build with mpv 2.0 (gh#mpv-player/mpv#9541, gh#u8sand/Baka-MPlayer#317) + * Port-away-from-deprecated-removed-APIs-in-mpv-2.0.patch + +------------------------------------------------------------------- New: ---- Port-away-from-deprecated-removed-APIs-in-mpv-2.0.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ baka-mplayer.spec ++++++ --- /var/tmp/diff_new_pack.TOtJ49/_old 2022-02-26 17:02:51.179543241 +0100 +++ /var/tmp/diff_new_pack.TOtJ49/_new 2022-02-26 17:02:51.183543241 +0100 @@ -1,7 +1,7 @@ # # spec file for package baka-mplayer # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,10 +20,12 @@ Version: 2.0.4 Release: 0 Summary: A media player with UI using libmpv -License: GPL-2.0-or-later AND Apache-2.0 +License: Apache-2.0 AND GPL-2.0-or-later URL: http://bakamplayer.u8sand.net/ Source0: https://github.com/u8sand/Baka-MPlayer/archive/v%{version}.tar.gz#/Baka-MPlayer-%{version}.tar.gz Patch0: ceil.patch +# PATCH-FIX-UPSTREAM Fix build with mpv 2.0 gh#u8sand/Baka-MPlayer#317 +Patch1: Port-away-from-deprecated-removed-APIs-in-mpv-2.0.patch BuildRequires: libqt5-linguist BuildRequires: libqt5-qtbase-common-devel BuildRequires: pkgconfig @@ -42,7 +44,7 @@ %prep %setup -q -n Baka-MPlayer-%{version} -%patch0 -p1 +%autopatch -p1 %build %qmake5 src/Baka-MPlayer.pro CONFIG+="release install_translations man.extra" \ ++++++ Port-away-from-deprecated-removed-APIs-in-mpv-2.0.patch ++++++ >From 7864f248c3fcd21d1dfa80700fad62785c41cba3 Mon Sep 17 00:00:00 2001 From: Fushan Wen <qydwhotm...@gmail.com> Date: Mon, 21 Feb 2022 18:50:46 +0800 Subject: [PATCH 1/1] Port away from deprecated/removed APIs in mpv 2.0 Register observers as MPV_EVENT_IDLE is deprecated and MPV_EVENT_PAUSE/MPV_EVENT_UNPAUSE have been removed. --- src/mpvhandler.cpp | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/mpvhandler.cpp b/src/mpvhandler.cpp index 3665d4a..a6af51c 100644 --- a/src/mpvhandler.cpp +++ b/src/mpvhandler.cpp @@ -41,6 +41,8 @@ MpvHandler::MpvHandler(int64_t wid, QObject *parent): mpv_observe_property(mpv, 0, "sub-visibility", MPV_FORMAT_FLAG); mpv_observe_property(mpv, 0, "mute", MPV_FORMAT_FLAG); mpv_observe_property(mpv, 0, "core-idle", MPV_FORMAT_FLAG); + mpv_observe_property(mpv, 0, "idle-active", MPV_FORMAT_FLAG); + mpv_observe_property(mpv, 0, "pause", MPV_FORMAT_FLAG); mpv_observe_property(mpv, 0, "paused-for-cache", MPV_FORMAT_FLAG); // setup callback event handling @@ -191,6 +193,31 @@ bool MpvHandler::event(QEvent *event) ShowText(QString(), 0); } } + else if(QString(prop->name) == "idle-active") + { + if(prop->format == MPV_FORMAT_FLAG) + { + if((bool)*(unsigned*)prop->data) + { + fileInfo.length = 0; + setTime(0); + setPlayState(Mpv::Idle); + } + } + } + else if(QString(prop->name) == "pause") + { + if(prop->format == MPV_FORMAT_FLAG) + { + if((bool)*(unsigned*)prop->data) + { + setPlayState(Mpv::Paused); + ShowText(QString(), 0); + } + else + setPlayState(Mpv::Playing); + } + } else if(QString(prop->name) == "paused-for-cache") { if(prop->format == MPV_FORMAT_FLAG) @@ -203,12 +230,7 @@ bool MpvHandler::event(QEvent *event) } break; } - case MPV_EVENT_IDLE: - fileInfo.length = 0; - setTime(0); - setPlayState(Mpv::Idle); - break; - // these two look like they're reversed but they aren't. the names are misleading. + // these two look like they're reversed but they aren't. the names are misleading. case MPV_EVENT_START_FILE: setPlayState(Mpv::Loaded); break; @@ -216,13 +238,6 @@ bool MpvHandler::event(QEvent *event) setPlayState(Mpv::Started); LoadFileInfo(); SetProperties(); - case MPV_EVENT_UNPAUSE: - setPlayState(Mpv::Playing); - break; - case MPV_EVENT_PAUSE: - setPlayState(Mpv::Paused); - ShowText(QString(), 0); - break; case MPV_EVENT_END_FILE: if(playState == Mpv::Loaded) ShowText(tr("File couldn't be opened")); -- 2.35.1