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.
This commit is contained in:
Max Kellermann 2009-10-08 21:17:00 +02:00
parent e5857cb722
commit fd3934b849

View File

@ -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);
}