[vlc-commits] qml: only switch to the MaxiPlayer when the number of video tracks actually changes

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


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Oct 19 14:55:57 2020 +0200| [4379dc839c439524758efa378b381312f749d742] | committer: Pierre Lamot

qml: only switch to the MaxiPlayer when the number of video tracks actually changes

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

 modules/gui/qt/maininterface/qml/MainDisplay.qml | 6 +++---
 modules/gui/qt/player/input_models.cpp           | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml
index c3a9c5f6c6..5756122c3e 100644
--- a/modules/gui/qt/maininterface/qml/MainDisplay.qml
+++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml
@@ -383,9 +383,9 @@ Widgets.NavigableFocusScope {
             }
 
             Connections {
-                target: player.videoTracks
-                onDataChanged: {
-                    if (player.videoTracks.rowCount() > 0
+                target: player.videoTracks.count
+                onCountChanged: {
+                    if (player.videoTracks.count > 0
                             && player.playingState === PlayerController.PLAYING_STATE_PLAYING) {
                         g_mainDisplay.showPlayer()
                     }
diff --git a/modules/gui/qt/player/input_models.cpp b/modules/gui/qt/player/input_models.cpp
index e45955a627..3cfdeddcfb 100644
--- a/modules/gui/qt/player/input_models.cpp
+++ b/modules/gui/qt/player/input_models.cpp
@@ -144,6 +144,7 @@ void TrackListModel::clear()
     beginRemoveRows({}, 0, m_data.size() - 1);
     m_data.clear();
     endRemoveRows();
+    emit countChanged();
 }
 
 QHash<int, QByteArray> TrackListModel::roleNames() const



More information about the vlc-commits mailing list