]> git.sesse.net Git - vlc/commitdiff
Use the new object locking API
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 10:40:28 +0000 (10:40 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 10:40:28 +0000 (10:40 +0000)
modules/misc/screensaver.c

index 166e0daa8fd28647f19b9fd1eacfe59bf7e0ade1..956879b8492af9a63ff2a245e323a7cd2ad2963f 100644 (file)
@@ -140,16 +140,19 @@ static void Run( intf_thread_t *p_intf )
     p_intf->p_sys->p_connection = dbus_init( p_intf );
 #endif
 
-    while( !b_quit )
+    for(;;)
     {
+        vlc_object_t *p_vout;
+        vlc_bool_t b_quit;
+
         /* Check screensaver every 30 seconds */
-        vlc_mutex_lock( &p_intf->object_lock );
-        vlc_cond_timedwait( &p_intf->object_wait, &p_intf->object_lock,
-                            mdate() + 30000000 );
-        b_quit = p_intf->b_die;
-        vlc_mutex_unlock( &p_intf->object_lock );
+        vlc_object_lock( p_intf );
+        b_quit = vlc_object_timedwait( p_intf, mdate() + 30000000 ) < 0;
+        vlc_object_unlock( p_intf );
+
+        if( b_quit )
+            break;
 
-        vlc_object_t *p_vout;
         p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
 
         /* If there is a video output, disable xscreensaver */