Do not lock the input while talking to D-Bus
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 3 Sep 2008 18:11:52 +0000 (21:11 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 3 Sep 2008 19:35:06 +0000 (22:35 +0300)
modules/misc/inhibit.c

index b88b6a3..da182ae 100644 (file)
@@ -230,28 +230,24 @@ static void Run( intf_thread_t *p_intf )
         p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
         if( p_input )
         {
-            if( PLAYING_S == p_input->i_state && !p_intf->p_sys->i_cookie )
+            int i_state = p_input->i_state;
+            vlc_object_release( p_input );
+
+            if( PLAYING_S == i_state && !p_intf->p_sys->i_cookie )
             {
                 if( !Inhibit( p_intf ) )
-                {
-                    vlc_object_release( p_input );
-                    goto end;
-                }
+                    break;
             }
             else if( p_intf->p_sys->i_cookie )
             {
                 if( !UnInhibit( p_intf ) )
-                {
-                    vlc_object_release( p_input );
-                    goto end;
-                }
+                    break;
             }
-            vlc_object_release( p_input );
         }
         else if( p_intf->p_sys->i_cookie )
         {
             if( !UnInhibit( p_intf ) )
-                goto end;
+                break;
         }
     }