chiark / gitweb /
Fix a bug where Disobedience wouldn't always notice that a track had
authorRichard Kettlewell <rjk@greenend.org.uk>
Mon, 30 Nov 2009 20:50:36 +0000 (20:50 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Mon, 30 Nov 2009 20:50:36 +0000 (20:50 +0000)
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.

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
disobedience/queue.c

index f1c4f79d814597863d0a717425a484871c0b2789..71d2af04bf32c006e91a4dff7642a251be0d1265 100644 (file)
@@ -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 */
index 60c7ca70ec4bb2ad464d439b5ee92da60131c251..9cabb9e854fbd050b65e665371fddd00c7cc620a 100644 (file)
@@ -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);