Qt: missing locks when calling the playlist
[vlc.git] / 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: