]> git.sesse.net Git - vlc/commitdiff
Reduce wakeup frequencies
authorClément Stenac <zorglub@videolan.org>
Sun, 17 Sep 2006 14:43:42 +0000 (14:43 +0000)
committerClément Stenac <zorglub@videolan.org>
Sun, 17 Sep 2006 14:43:42 +0000 (14:43 +0000)
modules/misc/screensaver.c
src/playlist/thread.c

index 36d87d51a99426c9a9e834bce1b56d66563c2359..28b6196a4b63875e7cf24fe94f207aaa36a7f395 100644 (file)
@@ -142,7 +142,7 @@ static void Run( intf_thread_t *p_intf )
 
     while( !p_intf->b_die )
     {
-        msleep( 100000 );
+        msleep( INTF_IDLE_SLEEP*5 ); // 250ms
 
         /* Check screensaver every 30 seconds */
         if( ++i_lastcall > 300 )
index 78fb70a57521f1a753a2f44df379a603f6cd1323..260b4b4395b15e6858caf5defbd772690c0f1076 100644 (file)
@@ -141,20 +141,10 @@ static void RunControlThread ( playlist_t *p_playlist )
 
         HandleInteraction( p_playlist );
         HandleStats( p_playlist, i_loops );
-
         HandlePlaylist( p_playlist );
 
-        msleep( INTF_IDLE_SLEEP / 2 );
-
-        /* Stop sleeping earlier if we have work */
-        /* TODO : statistics about this */
-        if ( p_playlist->request.b_request &&
-                        p_playlist->status.i_status == PLAYLIST_RUNNING )
-        {
-            continue;
-        }
-
-        msleep( INTF_IDLE_SLEEP / 2 );
+        /* 100 ms is an acceptable delay for playlist operations */
+        msleep( INTF_IDLE_SLEEP*2 );
     }
 
     EndPlaylist( p_playlist );
@@ -233,7 +223,7 @@ static void HandleInteraction( playlist_t *p_playlist )
  *****************************************************************************/
 static void HandleStats( playlist_t *p_playlist, int i_loops )
 {
-    if( i_loops %5 == 0 && p_playlist->p_stats )
+    if( i_loops % 5 == 0 && p_playlist->p_stats )
     {
         stats_ComputeGlobalStats( p_playlist, p_playlist->p_stats );
         if( p_playlist->p_input )