aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-12 18:40:36 +0100
committerMax Kellermann <max@duempel.org>2009-11-12 18:40:36 +0100
commitb9866e43d3311e9ce147442e378e12b2806b50ab (patch)
tree310aa3ee6ebdacf7f559945695470a76ae3bd1fe
parent9947b82cade61f034e1f4ede6565099406330a5c (diff)
downloadmpd-b9866e43d3311e9ce147442e378e12b2806b50ab.tar.gz
mpd-b9866e43d3311e9ce147442e378e12b2806b50ab.tar.xz
mpd-b9866e43d3311e9ce147442e378e12b2806b50ab.zip
player_control: hold lock while reading status
-rw-r--r--src/player_control.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/player_control.c b/src/player_control.c
index fc321b173..b7e802b9d 100644
--- a/src/player_control.c
+++ b/src/player_control.c
@@ -176,7 +176,8 @@ pc_set_pause(bool pause_flag)
void
pc_get_status(struct player_status *status)
{
- player_command(PLAYER_COMMAND_REFRESH);
+ player_lock();
+ player_command_locked(PLAYER_COMMAND_REFRESH);
status->state = pc.state;
@@ -186,6 +187,8 @@ pc_get_status(struct player_status *status)
status->total_time = pc.total_time;
status->elapsed_time = pc.elapsed_time;
}
+
+ player_unlock();
}
enum player_state