Skip to content

Commit

Permalink
Qt: missing locks when calling the playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkempf committed May 31, 2016
1 parent b2d60da commit 0974ffb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/gui/qt/components/playlist/playlist_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0974ffb

Please sign in to comment.