Commit fd3934b8 authored by Max Kellermann's avatar Max Kellermann

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.
parent e5857cb7
...@@ -75,21 +75,27 @@ pc_play(struct song *song) ...@@ -75,21 +75,27 @@ pc_play(struct song *song)
if (pc.state != PLAYER_STATE_STOP) if (pc.state != PLAYER_STATE_STOP)
player_command(PLAYER_COMMAND_STOP); player_command(PLAYER_COMMAND_STOP);
assert(pc.next_song == NULL);
pc.next_song = song; pc.next_song = song;
player_command(PLAYER_COMMAND_PLAY); player_command(PLAYER_COMMAND_PLAY);
assert(pc.next_song == NULL);
idle_add(IDLE_PLAYER); idle_add(IDLE_PLAYER);
} }
void pc_cancel(void) void pc_cancel(void)
{ {
player_command(PLAYER_COMMAND_CANCEL); player_command(PLAYER_COMMAND_CANCEL);
assert(pc.next_song == NULL);
} }
void void
pc_stop(void) pc_stop(void)
{ {
player_command(PLAYER_COMMAND_CLOSE_AUDIO); player_command(PLAYER_COMMAND_CLOSE_AUDIO);
assert(pc.next_song == NULL);
idle_add(IDLE_PLAYER); idle_add(IDLE_PLAYER);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment