summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-28 20:24:22 +0200
committerGravatar waker <wakeroid@gmail.com>2011-03-28 20:24:22 +0200
commitbd53ff68a03689b9de8e5203bcf313d4b80591e4 (patch)
tree14ee7dda01885c9e03a1681f0a0596231169b255 /playlist.c
parentde862934571eb38848c8958d8e3c60c4856f3976 (diff)
fix race condition in pl_format_item_queue
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index a6ab55df..6b40568c 100644
--- a/playlist.c
+++ b/playlist.c
@@ -2639,6 +2639,7 @@ pl_get_item_replaygain (playItem_t *it, int idx) {
int
pl_format_item_queue (playItem_t *it, char *s, int size) {
+ LOCK;
*s = 0;
int initsize = size;
const char *val = pl_find_meta (it, "_playing");
@@ -2686,9 +2687,9 @@ pl_format_item_queue (playItem_t *it, char *s, int size) {
}
if (!playqueue_count) {
+ UNLOCK;
return 0;
}
- LOCK;
int qinitsize = size;
int init = 1;