From c2bbf876fb93e2693f284d1852cca5212a1b6191 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Feb 2009 08:18:28 +0100 Subject: [PATCH] player: added some more assertions Assertions on pc.command and pc.next_song. --- src/player_control.c | 2 ++ src/player_thread.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/player_control.c b/src/player_control.c index 68b438cbc..5d95fb093 100644 --- a/src/player_control.c +++ b/src/player_control.c @@ -57,6 +57,8 @@ pc_song_deleted(const struct song *song) static void player_command(enum player_command cmd) { + assert(pc.command == PLAYER_COMMAND_NONE); + pc.command = cmd; while (pc.command != PLAYER_COMMAND_NONE) { notify_signal(&pc.notify); diff --git a/src/player_thread.c b/src/player_thread.c index f6069b048..b1b08c52d 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -526,6 +526,8 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg) switch (pc.command) { case PLAYER_COMMAND_PLAY: case PLAYER_COMMAND_QUEUE: + assert(pc.next_song != NULL); + do_play(); break;