]> git.sesse.net Git - vlc/commitdiff
src/control/core.c, include/vlc/control.h: Applied patch from Filippo Carone,
authorOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Sat, 10 Dec 2005 11:34:20 +0000 (11:34 +0000)
committerOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Sat, 10 Dec 2005 11:34:20 +0000 (11:34 +0000)
 using vlc_object_id instead of a direct p_object pointer as parameter
 for mediacontrol_new_from_object

include/vlc/control.h
src/control/core.c

index 934cc83e219527ce0575558400573f59cd977f4c..a001bc8c07cb62ac6f20a5b01ca459504384c74e 100644 (file)
@@ -2,7 +2,7 @@
  * control.h: global header for mediacontrol
  *****************************************************************************
  * Copyright (C) 2005 the VideoLAN team
- * $Id: vlc.h 10101 2005-03-02 16:47:31Z robux4 $
+ * $Id$
  *
  * Authors: Olivier Aubert <olivier.aubert@liris.univ-lyon1.fr>
  *
@@ -142,7 +142,7 @@ mediacontrol_Instance *
   mediacontrol_new( char **args, mediacontrol_Exception *exception );
 
 mediacontrol_Instance *
-  mediacontrol_new_from_object( vlc_object_t *p_object,
+  mediacontrol_new_from_object( int vlc_object_id,
                                 mediacontrol_Exception *exception );
 
 mediacontrol_Position *
index e763f436d5efbb1d98ab84b857ec1315d9351dca..3a48f207c8b00e11b6e27405c9a01e32e48ea57d 100644 (file)
@@ -2,7 +2,7 @@
  * core.c: Core functions : init, playlist, stream management
  *****************************************************************************
  * Copyright (C) 2005 the VideoLAN team
- * $Id: vlc.c 10786 2005-04-23 23:19:17Z zorglub $
+ * $Id$
  *
  * Authors: Olivier Aubert <olivier.aubert@liris.univ-lyon1.fr>
  *
                        exception->message = strdup(m);
 
 
-mediacontrol_Instance* mediacontrol_new_from_object( vlc_object_t* p_object,
+mediacontrol_Instance* mediacontrol_new_from_object( int vlc_object_id,
                                                      mediacontrol_Exception *exception )
 {
     mediacontrol_Instance* retval;
     vlc_object_t *p_vlc;
+    vlc_object_t *p_object;
+
+    p_object = ( vlc_object_t* )vlc_current_object( vlc_object_id );
+    if( ! p_object )
+    {
+        RAISE( mediacontrol_InternalException, "Unable to find vlc object" );
+        return NULL;
+    }
 
     p_vlc = vlc_object_find( p_object, VLC_OBJECT_ROOT, FIND_PARENT );
     if( ! p_vlc )