[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: fix race condition while switching to the player

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Feb 6 19:09:40 UTC 2023



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
65270bc8 by Pierre Lamot at 2023-02-06T18:31:27+00:00
qml: fix race condition while switching to the player

when pushing the player, the current view is may be destroyed before the end of
the function, this may cause the model to become undefined before medias are
added to the playqueue. This became noticeable since the the view transition
has been removed

- - - - -
3aa2648c by Pierre Lamot at 2023-02-06T18:31:27+00:00
qml: fix video progress indicator when progress is undefined

- - - - -
10a42348 by Pierre Lamot at 2023-02-06T18:31:27+00:00
qml: remove conflicting anchors in StackView components

anchors are already set by the Stackview

- - - - -
65b9b2de by Pierre Lamot at 2023-02-06T18:31:27+00:00
qml: lock the toolbar when aspect ratio combo box is opened

- - - - -


8 changed files:

- modules/gui/qt/medialibrary/qml/MusicPlaylistsDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoAll.qml
- modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
- modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
- modules/gui/qt/medialibrary/qml/VideoGridItem.qml
- modules/gui/qt/medialibrary/qml/VideoPlaylistsDisplay.qml
- modules/gui/qt/network/qml/BrowseDeviceView.qml
- modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicPlaylistsDisplay.qml
=====================================
@@ -94,8 +94,6 @@ Widgets.PageLoader {
         id: componentAll
 
         PlaylistMediaList {
-            anchors.fill: parent
-
             isMusic: true
 
             onCurrentIndexChanged: _updateHistoryList(currentIndex)
@@ -115,8 +113,6 @@ Widgets.PageLoader {
         PlaylistMediaDisplay {
             id: playlist
 
-            anchors.fill: parent
-
             isMusic: true
 
             onCurrentIndexChanged: _updateHistoryPlaylist(playlist)


=====================================
modules/gui/qt/medialibrary/qml/VideoAll.qml
=====================================
@@ -137,9 +137,8 @@ FocusScope {
     // Events
 
     function onAction(indexes) {
-        g_mainDisplay.showPlayer()
-
         MediaLib.addAndPlay(model.getIdsForIndexes(indexes))
+        g_mainDisplay.showPlayer()
     }
 
     function onDoubleClick(object) {


=====================================
modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
=====================================
@@ -125,9 +125,8 @@ VideoAll {
             property var model: MLVideoModel { ml: MediaLib }
 
             function onAction(indexes) {
-                g_mainDisplay.showPlayer()
-
                 MediaLib.addAndPlay(model.getIdsForIndexes(indexes))
+                g_mainDisplay.showPlayer()
             }
 
             function onDoubleClick(object) { g_mainDisplay.play(MediaLib, object.id) }
@@ -153,9 +152,8 @@ VideoAll {
                 var object = model.getDataAt(index);
 
                 if (object.isVideo) {
-                    g_mainDisplay.showPlayer()
-
                     MediaLib.addAndPlay(model.getIdsForIndexes(indexes))
+                    g_mainDisplay.showPlayer()
 
                     return
                 }


=====================================
modules/gui/qt/medialibrary/qml/VideoDisplayRecentVideos.qml
=====================================
@@ -48,8 +48,8 @@ FocusScope {
     // Functions
 
     function _actionAtIndex(index) {
-        g_mainDisplay.showPlayer()
         MediaLib.addAndPlay( model.getIdForIndexes(index), [":restore-playback-pos=2"] )
+        g_mainDisplay.showPlayer()
     }
 
     // Childs
@@ -151,8 +151,8 @@ FocusScope {
 
                 function play() {
                     if (model.id !== undefined) {
-                        g_mainDisplay.showPlayer()
                         MediaLib.addAndPlay( model.id, [":restore-playback-pos=2"] )
+                        g_mainDisplay.showPlayer()
                     }
                 }
             }


=====================================
modules/gui/qt/medialibrary/qml/VideoGridItem.qml
=====================================
@@ -36,8 +36,8 @@ Widgets.GridItem {
 
     function play() {
         if ( model.id !== undefined ) {
-            g_mainDisplay.showPlayer()
             MediaLib.addAndPlay( model.id )
+            g_mainDisplay.showPlayer()
         }
     }
 
@@ -77,7 +77,7 @@ Widgets.GridItem {
             visible: (model.progress > 0)
 
             radius: root.pictureRadius
-            value: Helpers.clamp(model.progress, 0, 1)
+            value: Helpers.clamp(model.progress !== undefined ? model.progress : 0, 0, 1)
         }
     }
 


=====================================
modules/gui/qt/medialibrary/qml/VideoPlaylistsDisplay.qml
=====================================
@@ -94,7 +94,6 @@ Widgets.PageLoader {
         id: componentAll
 
         PlaylistMediaList {
-            anchors.fill: parent
 
             isMusic: false
 
@@ -115,8 +114,6 @@ Widgets.PageLoader {
         PlaylistMediaDisplay {
             id: playlist
 
-            anchors.fill: parent
-
             isMusic: false
 
             onCurrentIndexChanged: _updateHistoryPlaylist(playlist)


=====================================
modules/gui/qt/network/qml/BrowseDeviceView.qml
=====================================
@@ -228,8 +228,6 @@ FocusScope {
                                                 ? -1
                                                 : root.maximumRows * nbItemPerRow
 
-            anchors.fill: parent
-
             cellWidth: VLCStyle.gridItem_network_width
             cellHeight: VLCStyle.gridItem_network_height
 
@@ -271,8 +269,6 @@ FocusScope {
 
             readonly property int _nameColSpan: Math.max((_nbCols - 1) / 2, 1)
 
-            anchors.fill: parent
-
             rowHeight: VLCStyle.tableCoverRow_height
 
             displayMarginEnd: root.displayMarginEnd


=====================================
modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml
=====================================
@@ -24,7 +24,11 @@ import "qrc:///style/"
 
 
 Widgets.ComboBoxExt {
+    id: combo
     property bool paintOnly: false
+
+    signal requestLockUnlockAutoHide(bool lock)
+
     width: VLCStyle.combobox_width_normal
     height: VLCStyle.combobox_height_normal
     textRole: "display"
@@ -32,4 +36,10 @@ Widgets.ComboBoxExt {
     currentIndex: -1
     onCurrentIndexChanged: model.toggleIndex(currentIndex)
     Accessible.name: I18n.qtr("Aspect ratio")
+
+    Connections {
+        target: combo.popup
+        onOpened: combo.requestLockUnlockAutoHide(true)
+        onClosed: combo.requestLockUnlockAutoHide(false)
+    }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6d749765124cf10469609dacf38ff8d99ff2eda7...65b9b2de62f3d6f9af379dab1263689b4531f0d4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6d749765124cf10469609dacf38ff8d99ff2eda7...65b9b2de62f3d6f9af379dab1263689b4531f0d4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list