[vlc-devel] commit: HTTP interface: get rid of vlc_object_find ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Jan 19 17:50:02 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Mon Jan 19 18:48:07 2009 +0200| [d669e2c099b8b0ca585ef130bef3f4ed7d2f1e67] | committer: Rémi Denis-Courmont 

HTTP interface: get rid of vlc_object_find

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d669e2c099b8b0ca585ef130bef3f4ed7d2f1e67
---

 modules/control/http/macro.c |    3 +--
 modules/control/http/rpn.c   |   25 ++++++++++---------------
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/modules/control/http/macro.c b/modules/control/http/macro.c
index 7ecf1da..6c6a443 100644
--- a/modules/control/http/macro.c
+++ b/modules/control/http/macro.c
@@ -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;
diff --git a/modules/control/http/rpn.c b/modules/control/http/rpn.c
index 50aa5e8..a6551b3 100644
--- a/modules/control/http/rpn.c
+++ b/modules/control/http/rpn.c
@@ -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 );




More information about the vlc-devel mailing list