[vlc-commits] qt: propose restoring playback only once per media

Pierre Lamot git at videolan.org
Mon Dec 7 12:31:58 UTC 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Oct 19 18:21:38 2020 +0200| [f6e130f96e0fc092db2d705ac4e75bdb0321b0b1] | committer: Pierre Lamot

qt: propose restoring playback only once per media

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f6e130f96e0fc092db2d705ac4e75bdb0321b0b1
---

 modules/gui/qt/player/player_controller.cpp | 9 +++++++++
 modules/gui/qt/player/player_controller.hpp | 1 +
 modules/gui/qt/player/qml/ResumeDialog.qml  | 1 +
 3 files changed, 11 insertions(+)

diff --git a/modules/gui/qt/player/player_controller.cpp b/modules/gui/qt/player/player_controller.cpp
index d224843a18..0b7292e2fa 100644
--- a/modules/gui/qt/player/player_controller.cpp
+++ b/modules/gui/qt/player/player_controller.cpp
@@ -1625,6 +1625,15 @@ void PlayerController::restorePlaybackPos()
     vlc_player_RestorePlaybackPos( d->m_player );
 }
 
+void PlayerController::acknowledgeRestoreCallback()
+{
+    Q_D(PlayerController);
+    if (d->m_canRestorePlayback) {
+        d->m_canRestorePlayback = false;
+        emit playbackRestoreQueried();
+    }
+}
+
 //MISC
 
 void PlayerController::setABloopState(ABLoopState state)
diff --git a/modules/gui/qt/player/player_controller.hpp b/modules/gui/qt/player/player_controller.hpp
index f45aedacf5..2a23d2c2d7 100644
--- a/modules/gui/qt/player/player_controller.hpp
+++ b/modules/gui/qt/player/player_controller.hpp
@@ -282,6 +282,7 @@ public slots:
     bool canRestorePlayback() const;
     void restorePlaybackPos();
     void openVLsub();
+    void acknowledgeRestoreCallback();
 
     //tracks
     TrackListModel* getVideoTracks();
diff --git a/modules/gui/qt/player/qml/ResumeDialog.qml b/modules/gui/qt/player/qml/ResumeDialog.qml
index 72c2bc5b97..68029e41b7 100644
--- a/modules/gui/qt/player/qml/ResumeDialog.qml
+++ b/modules/gui/qt/player/qml/ResumeDialog.qml
@@ -44,6 +44,7 @@ Widgets.NavigableFocusScope {
     function hideResumePanel() {
         resumeTimeout.stop()
         resumePanel.visible = false
+        player.acknowledgeRestoreCallback()
         hidden()
     }
 



More information about the vlc-commits mailing list