From 443c003c99eadf48468e1b20b664005a0b633c31 Mon Sep 17 00:00:00 2001 Message-Id: <443c003c99eadf48468e1b20b664005a0b633c31.1715192962.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 30 Nov 2009 20:50:36 +0000 Subject: [PATCH] Fix a bug where Disobedience wouldn't always notice that a track had started playing. If you turn off random play, then either scratch or wait for the current track, then turn random play on again then it would not notice the new track. Organization: Straylight/Edgeware From: Richard Kettlewell The reason is that random track choice is now asynchronous to start a new track and Disobedience wasn't listening for "playing" log messages. Now it does. --- disobedience/log.c | 1 + disobedience/queue.c | 1 + 2 files changed, 2 insertions(+) diff --git a/disobedience/log.c b/disobedience/log.c index f1c4f79..71d2af0 100644 --- a/disobedience/log.c +++ b/disobedience/log.c @@ -115,6 +115,7 @@ static void log_moved(void attribute((unused)) *v, static void log_playing(void attribute((unused)) *v, const char attribute((unused)) *track, const char attribute((unused)) *user) { + event_raise("playing-started", 0); } /** @brief Called when a track is added to the queue */ diff --git a/disobedience/queue.c b/disobedience/queue.c index 60c7ca7..9cabb9e 100644 --- a/disobedience/queue.c +++ b/disobedience/queue.c @@ -157,6 +157,7 @@ static gboolean playing_periodic(gpointer attribute((unused)) data) { static void queue_init(struct queuelike attribute((unused)) *ql) { /* Arrange a callback whenever the playing state changes */ event_register("playing-changed", playing_changed, 0); + event_register("playing-started", playing_changed, 0); /* We reget both playing track and queue at pause/resume so that start times * can be computed correctly */ event_register("pause-changed", playing_changed, 0); -- [mdw]