Qt: missing locks when calling the playlist
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 31 May 2016 15:43:08 +0000 (17:43 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 31 May 2016 15:43:08 +0000 (17:43 +0200)
modules/gui/qt/components/playlist/playlist_model.cpp

index d215603..1ee67a7 100644 (file)
@@ -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: