]> git.sesse.net Git - vlc/commitdiff
Do not try to connect to last.fm every second if the request fails, and server allows...
authorRafaël Carré <funman@videolan.org>
Fri, 14 Sep 2007 00:00:17 +0000 (00:00 +0000)
committerRafaël Carré <funman@videolan.org>
Fri, 14 Sep 2007 00:00:17 +0000 (00:00 +0000)
modules/misc/audioscrobbler.c

index 929b5d09f9340dc7d63f80a09db511afb46c5146..576baaeca35ba27f603c7d2e17b59f4e0c091620 100644 (file)
@@ -449,7 +449,7 @@ static void Main( intf_thread_t *p_this )
             net_Close( i_post_socket );
 
             /* record interval */
-            p_buffer_pos = strstr( ( char * ) p_buffer, "INTERVAL" );
+            p_buffer_pos = strstr( ( char * ) p_buffer, "INTERVAL " );
             if ( p_buffer_pos )
             {
                 time( &p_sys->time_next_exchange );
@@ -462,6 +462,8 @@ static void Main( intf_thread_t *p_this )
             {
                 /* woops, submission failed */
                 msg_Dbg( p_this, "%s", p_buffer_pos );
+                /* Buggy last.fm server sometimes return INTERVAL 1 */
+                p_sys->time_next_exchange += DEFAULT_INTERVAL;
                 vlc_mutex_unlock ( &p_sys->lock );
                 continue;
             }