From 4748decd8df52f747605271fac18f94437b78e0c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 29 Oct 2009 22:39:48 +0100 Subject: player_thread: set error status in play_next_chunk() Don't set the error in play_chunk(); do all the error handling in the caller. The errored_song attribute isn't set anymore; it doesn't make sense for PLAYER_ERROR_AUDIO. --- src/player_thread.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/player_thread.c') diff --git a/src/player_thread.c b/src/player_thread.c index 1794ad404..9d13e44f9 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -472,11 +472,8 @@ play_chunk(struct song *song, struct music_chunk *chunk, /* send the chunk to the audio outputs */ - if (!audio_output_all_play(chunk)) { - pc.errored_song = dc.current_song; - pc.error = PLAYER_ERROR_AUDIO; + if (!audio_output_all_play(chunk)) return false; - } pc.total_play_time += (double)chunk->length / audio_format_time_to_size(format); @@ -562,6 +559,8 @@ play_next_chunk(struct player *player) if (!success) { music_buffer_return(player_buffer, chunk); + pc.error = PLAYER_ERROR_AUDIO; + /* pause: the user may resume playback as soon as an audio output becomes available */ pc.state = PLAYER_STATE_PAUSE; -- cgit v1.2.3