From 90feba667b833eca6ff2362af527fe5defa4cff9 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 7 Jul 2023 13:25:08 +0300 Subject: [PATCH] mpv: fix pause state for files loaded from CLI Signed-off-by: Mavridis Philippe --- .../src/player-parts/libmpv-part/libmpv_part.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kaffeine/src/player-parts/libmpv-part/libmpv_part.cpp b/kaffeine/src/player-parts/libmpv-part/libmpv_part.cpp index a910e6e..0c71857 100644 --- a/kaffeine/src/player-parts/libmpv-part/libmpv_part.cpp +++ b/kaffeine/src/player-parts/libmpv-part/libmpv_part.cpp @@ -376,6 +376,7 @@ bool MpvPart::openURL(const MRL& mrl) { m_playlist.append( m_mrl ); } + m_mrl.reset(); slotPlay(); return true; } @@ -395,18 +396,16 @@ bool MpvPart::closeURL() { void MpvPart::slotPlay() { if (!m_mpv) return; - if (isPaused()) { - slotPause(false); - if (!m_mrl.url().isEmpty()) { - return; - } + slotPause(false); + if (!m_mrl.isEmpty()) { + return; } if (m_playlist.count() > 0) { emit setStatusBarText( i18n("Opening...") ); - MRL curMRL = m_playlist[m_current]; + m_mrl = m_playlist[m_current]; - const char *args[] = {"loadfile", curMRL.url().local8Bit(), nullptr}; + const char *args[] = {"loadfile", m_mrl.url().local8Bit(), nullptr}; mpv_command_async(m_mpv, 0, args); slotReloadSubtitles();