From 96dc0a318afc5eba581696640a50f652cc3fc964 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Feb 2013 10:15:34 +0100 Subject: player_thread: implement missing "idle" events on output errors When all outputs fail, MPD automatically pauses playback, but did not emit the IDLE_PLAYER event. Thus, clients were not woken up. (Mantis 3665) --- NEWS | 2 ++ src/player_thread.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f57736b0..c92c0fa2 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.17.4 (2013/??/??) * decoder: - ffmpeg: support float planar audio (ffmpeg 1.1) +* player: + - implement missing "idle" events on output errors ver 0.17.3 (2013/01/06) diff --git a/src/player_thread.c b/src/player_thread.c index 707fb27a..593788ca 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -326,6 +326,8 @@ player_open_output(struct player *player) pc->state = PLAYER_STATE_PAUSE; player_unlock(pc); + idle_add(IDLE_PLAYER); + return false; } } @@ -800,6 +802,8 @@ play_next_chunk(struct player *player) player_unlock(pc); + idle_add(IDLE_PLAYER); + return false; } @@ -845,13 +849,17 @@ player_song_border(struct player *player) struct player_control *const pc = player->pc; player_lock(pc); - if (pc->border_pause) { + const bool border_pause = pc->border_pause; + if (border_pause) { player->paused = true; pc->state = PLAYER_STATE_PAUSE; } player_unlock(pc); + if (border_pause) + idle_add(IDLE_PLAYER); + return true; } -- cgit v1.2.3