disobedience/queue.c: Don't ramp up network activity when not playing.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 2 Jun 2020 01:53:29 +0000 (02:53 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 3 Jun 2020 20:49:07 +0000 (21:49 +0100)
If you paused the current track, or disabled playing, then Disobedience
would send a `queue' command every second, eating about 2.5 kB/s of
network for no good reason.  Fix this.

disobedience/queue.c

index 95ff0d5..748b8e3 100644 (file)
@@ -140,7 +140,7 @@ static gboolean playing_periodic(gpointer attribute((unused)) data) {
    * do it once a minute then the rest of the queue can get out of date too
    * easily.) */
   struct queue_entry *q = ql_queue.q;
-  if(q) {
+  if(q && playing_track && !(last_state&(DISORDER_TRACK_PAUSED))) {
     if(q == playing_track)
       q = q->next;
     if(q) {