From 4b7c28f98eb539a73415030fc9c914444d33b2ef Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Feb 2009 18:02:52 +0100 Subject: 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. --- src/player_thread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/player_thread.c') 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; -- cgit v1.2.3