diff options
author | Max Kellermann <max@duempel.org> | 2009-10-08 21:17:00 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-08 21:17:00 +0200 |
commit | fd3934b8492190254351130be2f0f4c923b08ac3 (patch) | |
tree | 12698c67aba6c8ea22b7ce8dc71ed680d77d43d5 /src | |
parent | e5857cb722c4ce3319cb35c3c26c26ab2c5a8d33 (diff) | |
download | mpd-fd3934b8492190254351130be2f0f4c923b08ac3.tar.gz mpd-fd3934b8492190254351130be2f0f4c923b08ac3.tar.xz mpd-fd3934b8492190254351130be2f0f4c923b08ac3.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/player_control.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |