diff options
author | Max Kellermann <max@duempel.org> | 2009-02-10 00:17:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-10 00:17:34 +0100 |
commit | 2274434e53111a45c1ac90c139fbe84cce0c95a4 (patch) | |
tree | 98cab093bea2c9cc647842e24d2a49f09a922059 /src | |
parent | 710b3275ea09325131ca6f80cbcb98272424123d (diff) | |
download | mpd-2274434e53111a45c1ac90c139fbe84cce0c95a4.tar.gz mpd-2274434e53111a45c1ac90c139fbe84cce0c95a4.tar.xz mpd-2274434e53111a45c1ac90c139fbe84cce0c95a4.zip |
player_thread: reset pc.next_song
After a player command (successful or not), reset pc.next_song,
because the queue is supposed to be empty then. Otherwise,
playlist.queued and pc.next_song may disagree, which triggers an
assertion failure.
Diffstat (limited to 'src')
-rw-r--r-- | src/player_thread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index 622eab072..352ceabae 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -92,6 +92,7 @@ static void player_stop_decoder(void) { dc_stop(&pc.notify); pc.state = PLAYER_STATE_STOP; + pc.next_song = NULL; event_pipe_emit(PIPE_EVENT_PLAYLIST); } @@ -104,6 +105,7 @@ player_wait_for_decoder(struct player *player) assert(dc.next_song == NULL || dc.next_song->url != NULL); pc.errored_song = dc.next_song; pc.error = PLAYER_ERROR_FILE; + pc.next_song = NULL; return false; } @@ -138,6 +140,9 @@ static bool player_seek_decoder(struct player *player) ret = player_wait_for_decoder(player); if (!ret) return false; + } else { + pc.next_song = NULL; + player->queued = false; } where = pc.seek_where; @@ -523,6 +528,7 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg) case PLAYER_COMMAND_STOP: case PLAYER_COMMAND_SEEK: case PLAYER_COMMAND_PAUSE: + pc.next_song = NULL; player_command_finished(); break; |