From 89893faa19aef5623b8d4ea9e71b346edbd78435 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Nov 2009 20:02:19 +0100 Subject: decoder_control: merge next_song and current_song These two variables are redundant, we need only one of them. --- src/player_thread.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/player_thread.c') diff --git a/src/player_thread.c b/src/player_thread.c index e648ab375..fa02a2e0e 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -160,10 +160,8 @@ player_wait_for_decoder(struct player *player) struct decoder_control *dc = player->dc; if (decoder_lock_has_failed(dc)) { - assert(dc->next_song == NULL || dc->next_song->uri != NULL); - player_lock(); - pc.errored_song = dc->next_song; + pc.errored_song = dc->song; pc.error = PLAYER_ERROR_FILE; pc.next_song = NULL; player_unlock(); @@ -210,11 +208,9 @@ player_check_decoder_startup(struct player *player) if (decoder_has_failed(dc)) { /* the decoder failed */ - assert(dc->next_song == NULL || dc->next_song->uri != NULL); - decoder_unlock(dc); - pc.errored_song = dc->next_song; + pc.errored_song = dc->song; pc.error = PLAYER_ERROR_FILE; return false; @@ -237,12 +233,11 @@ player_check_decoder_startup(struct player *player) if (!player->paused && !audio_output_all_open(&dc->out_audio_format, player_buffer)) { - char *uri = song_get_uri(dc->next_song); + char *uri = song_get_uri(dc->song); g_warning("problems opening audio device " "while playing \"%s\"", uri); g_free(uri); - assert(dc->next_song == NULL || dc->next_song->uri != NULL); pc.error = PLAYER_ERROR_AUDIO; /* pause: the user may resume playback as soon @@ -433,7 +428,6 @@ static void player_process_command(struct player *player) } else { /* the audio device has failed - rollback to pause mode */ - assert(dc->next_song == NULL || dc->next_song->uri != NULL); pc.error = PLAYER_ERROR_AUDIO; player->paused = true; -- cgit v1.2.3