]> git.sesse.net Git - vlc/commitdiff
HTTP interface: get rid of vlc_object_find
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 19 Jan 2009 16:48:07 +0000 (18:48 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 19 Jan 2009 16:49:04 +0000 (18:49 +0200)
modules/control/http/macro.c
modules/control/http/rpn.c

index 7ecf1da13f8177a317c809a9359a652530e57994..6c6a443b250660dd0c1ff039f3e7c594bf107ae1 100644 (file)
@@ -230,9 +230,8 @@ static void MacroDo( httpd_file_sys_t *p_args,
                     if( p_sys->p_input )
                     {
                         vout_thread_t *p_vout;
-                        p_vout = vlc_object_find( p_sys->p_input,
-                                                  VLC_OBJECT_VOUT, FIND_CHILD );
 
+                        p_vout = input_GetVout( p_sys->p_input );
                         if( p_vout )
                         {
                             p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
index 50aa5e8a79f5911fd0bfc706f86c707c5195ceba..a6551b34e13783d630db7596a9f9f60328a80911 100644 (file)
@@ -36,7 +36,6 @@ static vlc_object_t *GetVLCObject( intf_thread_t *p_intf,
                                    bool *pb_need_release )
 {
     intf_sys_t    *p_sys = p_intf->p_sys;
-    int i_object_type = 0;
     vlc_object_t *p_object = NULL;
     *pb_need_release = false;
 
@@ -48,18 +47,17 @@ static vlc_object_t *GetVLCObject( intf_thread_t *p_intf,
         p_object = VLC_OBJECT(p_sys->p_playlist);
     else if( !strcmp( psz_object, "VLC_OBJECT_INPUT" ) )
         p_object = VLC_OBJECT(p_sys->p_input);
-    else if( !strcmp( psz_object, "VLC_OBJECT_VOUT" ) )
-        i_object_type = VLC_OBJECT_VOUT;
-    else if( !strcmp( psz_object, "VLC_OBJECT_AOUT" ) )
-        i_object_type = VLC_OBJECT_AOUT;
-    else
-        msg_Warn( p_intf, "unknown object type (%s)", psz_object );
-
-    if( p_object == NULL && i_object_type )
+    else if( p_sys->p_input )
     {
-        *pb_need_release = true;
-        p_object = vlc_object_find( p_intf, i_object_type, FIND_ANYWHERE );
+        if( !strcmp( psz_object, "VLC_OBJECT_VOUT" ) )
+            p_object = VLC_OBJECT( input_GetVout( p_sys->p_input ) );
+        else if( !strcmp( psz_object, "VLC_OBJECT_AOUT" ) )
+            p_object = VLC_OBJECT( input_GetAout( p_sys->p_input ) );
+        if( p_object )
+            *pb_need_release = true;
     }
+    else
+        msg_Warn( p_intf, "unknown object type (%s)", psz_object );
 
     return p_object;
 }
@@ -1123,10 +1121,7 @@ void EvaluateRPN( intf_thread_t *p_intf, mvar_t  *vars,
         {
             if( p_sys->p_input )
             {
-                vout_thread_t *p_vout;
-                p_vout = vlc_object_find( p_sys->p_input,
-                                          VLC_OBJECT_VOUT, FIND_CHILD );
-
+                vout_thread_t *p_vout = input_GetVout( p_sys->p_input );
                 if( p_vout )
                 {
                     vout_Control( p_vout, VOUT_SNAPSHOT );