[vlc-commits] Qt: missing locks when calling the playlist

Jean-Baptiste Kempf git at videolan.org
Tue May 31 17:43:36 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue May 31 17:43:08 2016 +0200| [0974ffb1bc9c42f9f90cccee403f94e30bb6498d] | committer: Jean-Baptiste Kempf

Qt: missing locks when calling the playlist

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

 modules/gui/qt/components/playlist/playlist_model.cpp |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index d215603..1ee67a7 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -1005,9 +1005,19 @@ bool PLModel::isSupportedAction( actions action, const QModelIndex &index ) cons
     case ACTION_SORT:
         return rowCount() && !item->readOnly();
     case ACTION_PLAY:
-        return !isCurrent( index ) || playlist_Status(THEPL) == PLAYLIST_PAUSED;
+    {
+        PL_LOCK;
+        bool b_ret = !isCurrent( index ) || playlist_Status(THEPL) == PLAYLIST_PAUSED;
+        PL_UNLOCK;
+        return b_ret;
+    }
     case ACTION_PAUSE:
-        return isCurrent( index ) && playlist_Status(THEPL) == PLAYLIST_RUNNING;
+    {
+        PL_LOCK;
+        bool b_ret = isCurrent( index ) && playlist_Status(THEPL) == PLAYLIST_RUNNING;
+        PL_UNLOCK;
+        return b_ret;
+    }
     case ACTION_STREAM:
     case ACTION_SAVE:
     case ACTION_INFO:



More information about the vlc-commits mailing list