X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/c10dd9af5b7dc416c1d138133c8e427d4adb2d51..f69359f894a89c728d8951dee115033a953a104c:/disobedience/queue.c diff --git a/disobedience/queue.c b/disobedience/queue.c index db013d3..72da908 100644 --- a/disobedience/queue.c +++ b/disobedience/queue.c @@ -40,7 +40,8 @@ static void playing_completed(void *v, /** @brief Called when either the actual queue or the playing track change */ static void queue_playing_changed(void) { - + const char *old_id = playing_track ? playing_track->id : 0; + /* Check that the playing track isn't in the queue. There's a race here due * to the fact that we issue the two commands at slightly different times. * If it goes wrong we re-issue and try again, so that we never offer up an @@ -66,7 +67,8 @@ static void queue_playing_changed(void) { playing_track = NULL; q = actual_queue; } - time(&last_playing); /* for column_length() */ + if(!old_id || !playing_track || strcmp(old_id, playing_track->id)) + time(&last_playing); /* for column_length() */ ql_new_queue(&ql_queue, q); /* Tell anyone who cares */ event_raise("queue-list-changed", q);