aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-02-04 10:15:34 +0100
committerMax Kellermann <max@duempel.org>2013-02-04 10:15:34 +0100
commit96dc0a318afc5eba581696640a50f652cc3fc964 (patch)
tree2a47fb284478a4b685228a1d26b105f7019466da /src/player_thread.c
parent1105e61f292fd61a6316a4b83439dbaa29c102fd (diff)
downloadmpd-96dc0a318afc5eba581696640a50f652cc3fc964.tar.gz
mpd-96dc0a318afc5eba581696640a50f652cc3fc964.tar.xz
mpd-96dc0a318afc5eba581696640a50f652cc3fc964.zip
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)
Diffstat (limited to '')
-rw-r--r--src/player_thread.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 707fb27ae..593788caf 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;
}