aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-02 18:02:52 +0100
committerMax Kellermann <max@duempel.org>2009-02-02 18:22:41 +0100
commit4b7c28f98eb539a73415030fc9c914444d33b2ef (patch)
tree31dc4ec4ee42a090dfd4db18946f390f018135c6
parentfdb80e74b7473f7357fdcc54eedd9a4f40963138 (diff)
downloadmpd-4b7c28f98eb539a73415030fc9c914444d33b2ef.tar.gz
mpd-4b7c28f98eb539a73415030fc9c914444d33b2ef.tar.xz
mpd-4b7c28f98eb539a73415030fc9c914444d33b2ef.zip
player_thread: set player error when output device fails
When the output device fails to play a chunk, set pc.error to PLAYER_ERROR_AUDIO. This way, the playlist knows that it should not queue the next song.
-rw-r--r--NEWS1
-rw-r--r--src/player_thread.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 074b1ec17..0190d4cc5 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,7 @@ ver 0.14.2 (2009/??/??)
- jack: clear "shutdown" flag on reconnect
- jack: reduced sleep time to 1ms
* mapper: remove trailing slashes from music_directory
+* player: set player error when output device fails
ver 0.14.1 (2009/01/17)
diff --git a/src/player_thread.c b/src/player_thread.c
index d150c4303..622eab072 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -268,8 +268,11 @@ play_chunk(struct song *song, struct music_chunk *chunk,
pcm_volume(chunk->data, chunk->length,
format, pc.software_volume);
- if (!playAudio(chunk->data, chunk->length))
+ if (!playAudio(chunk->data, chunk->length)) {
+ pc.errored_song = dc.current_song;
+ pc.error = PLAYER_ERROR_AUDIO;
return false;
+ }
pc.total_play_time += sizeToTime * chunk->length;
return true;