From fd3934b8492190254351130be2f0f4c923b08ac3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Oct 2009 21:17:00 +0200 Subject: [PATCH] player_control: added several assertions on pc.next_song==NULL After some of the commands, the player thread must have reset the pc.next_song attribute. --- src/player_control.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/player_control.c b/src/player_control.c index f20049484..2229efdf0 100644 --- a/src/player_control.c +++ b/src/player_control.c @@ -75,21 +75,27 @@ pc_play(struct song *song) if (pc.state != PLAYER_STATE_STOP) player_command(PLAYER_COMMAND_STOP); + assert(pc.next_song == NULL); + pc.next_song = song; player_command(PLAYER_COMMAND_PLAY); + assert(pc.next_song == NULL); + idle_add(IDLE_PLAYER); } void pc_cancel(void) { player_command(PLAYER_COMMAND_CANCEL); + assert(pc.next_song == NULL); } void pc_stop(void) { player_command(PLAYER_COMMAND_CLOSE_AUDIO); + assert(pc.next_song == NULL); idle_add(IDLE_PLAYER); }