aboutsummaryrefslogtreecommitdiff
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 20:02:19 +0100
committerMax Kellermann <max@duempel.org>2009-11-03 20:02:19 +0100
commit89893faa19aef5623b8d4ea9e71b346edbd78435 (patch)
tree0d1d33793285c06d5237709c5e40ed7e4a4040cb /src/player_thread.c
parentbfa7da943c2ee90ca84664ce0d97b77ed27311f9 (diff)
decoder_control: merge next_song and current_song
These two variables are redundant, we need only one of them.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index e648ab37..fa02a2e0 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;