chiark / gitweb /
Move RTP check. This seems to improve matters - formerly the RTP
authorRichard Kettlewell <rjk@greenend.org.uk>
Mon, 9 Jun 2008 21:06:12 +0000 (22:06 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Mon, 9 Jun 2008 21:06:12 +0000 (22:06 +0100)
status was set before DISORDER_CONNECTED was, leading to a false
negative.  This is a bit of a voodoo-ish change l-(

disobedience/disobedience.c

index 443eaa42ca1671435059b4c0c15b718bb64df534..b1c801f97b570e8d583cf57f1cbb913a09ee417f 100644 (file)
@@ -96,6 +96,8 @@ int rtp_supported;
 /** @brief True if RTP play is enabled */
 int rtp_is_running;
 
 /** @brief True if RTP play is enabled */
 int rtp_is_running;
 
+static void check_rtp_address(void);
+
 /* Window creation --------------------------------------------------------- */
 
 /* Note that all the client operations kicked off from here will only complete
 /* Window creation --------------------------------------------------------- */
 
 /* Note that all the client operations kicked off from here will only complete
@@ -325,6 +327,8 @@ static gboolean periodic_slow(gpointer attribute((unused)) data) {
                               config->username, "rights",
                               0);
   }
                               config->username, "rights",
                               0);
   }
+  /* Recheck RTP status too */
+  check_rtp_address();
   return TRUE;                          /* don't remove me */
 }
 
   return TRUE;                          /* don't remove me */
 }
 
@@ -449,7 +453,6 @@ void logged_in(void) {
   rtp_supported = 0;
   event_raise("logged-in", 0);
   /* Force the periodic checks */
   rtp_supported = 0;
   event_raise("logged-in", 0);
   /* Force the periodic checks */
-  check_rtp_address();
   periodic_slow(0);
   periodic_fast(0);
 }
   periodic_slow(0);
   periodic_fast(0);
 }
@@ -509,7 +512,6 @@ int main(int argc, char **argv) {
   /* Start monitoring the log */
   disorder_eclient_log(logclient, &log_callbacks, 0);
   /* Initiate all the checks */
   /* Start monitoring the log */
   disorder_eclient_log(logclient, &log_callbacks, 0);
   /* Initiate all the checks */
-  check_rtp_address();
   periodic_slow(0);
   periodic_fast(0);
   suppress_actions = 0;
   periodic_slow(0);
   periodic_fast(0);
   suppress_actions = 0;