diff options
author | Max Kellermann <max@duempel.org> | 2009-04-25 11:55:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-04-25 11:55:36 +0200 |
commit | 472b994779f30ff75dd2dab913770860fd88cd74 (patch) | |
tree | 8f9150d0f1f7b81e6aa883d06055cd859bb95d20 /src/player_thread.c | |
parent | 70faf5927531099af0701bf5281b37ff861d3e8d (diff) | |
download | mpd-472b994779f30ff75dd2dab913770860fd88cd74.tar.gz mpd-472b994779f30ff75dd2dab913770860fd88cd74.tar.xz mpd-472b994779f30ff75dd2dab913770860fd88cd74.zip |
player_thread: pause when all audio outputs fail to play
When all audio outputs have been closed due to failures, pause the
playback instead of stopping it. This way, the user may resume
at the current position after the problem has been dealt with.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r-- | src/player_thread.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index 39eb3a385..4ea23020d 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -549,6 +549,12 @@ play_next_chunk(struct player *player) if (!success) { music_buffer_return(player_buffer, chunk); + + /* pause: the user may resume playback as soon as an + audio output becomes available */ + pc.state = PLAYER_STATE_PAUSE; + player->paused = true; + return false; } @@ -708,8 +714,7 @@ static void do_play(void) /* at least one music chunk is ready - send it to the audio output */ - if (!play_next_chunk(&player)) - break; + play_next_chunk(&player); } else if (audio_output_all_check() > 0) { /* not enough data from decoder, but the output thread is still busy, so it's |