]> git.sesse.net Git - vlc/blobdiff - bindings/python/vlc_internal.c
The last but not least of this serie of memleaks.
[vlc] / bindings / python / vlc_internal.c
index 4b8d24d220836775bdd0187b86b0805361c186e2..b84b94b78fd8a42f3226dd3d798f64b9017a62b3 100644 (file)
@@ -22,6 +22,7 @@
  *****************************************************************************/
 
 #include "vlc_internal.h"
+#include "../../src/libvlc.h"
 
 /**************************************************************************
  * VLC Module
@@ -259,7 +260,6 @@ vlcObject_find_name( PyObject *self, PyObject *args )
     vlcObject *p_retval;
     vlc_object_t *p_obj;
     char *psz_name;
-    int i_object_type;
 
     if( !PyArg_ParseTuple( args, "s", &psz_name ) )
         return NULL;
@@ -284,8 +284,10 @@ vlcObject_info( PyObject *self, PyObject *args )
 {
     PyObject *p_retval;
     vlc_object_t *p_obj;
-
+    vlc_object_internals_t *p_priv;
+    
     p_obj = VLCSELF->p_object;
+    p_priv = vlc_internals( p_obj );
 
     /* Return information about the object as a dict. */
     p_retval = PyDict_New();
@@ -297,12 +299,11 @@ vlcObject_info( PyObject *self, PyObject *args )
     PyDict_SetItemString( p_retval, "object-name",
                           Py_BuildValue( "s", p_obj->psz_object_name ) );
     PyDict_SetItemString( p_retval, "thread",
-                          PyBool_FromLong( p_obj->b_thread ) );
+                          PyBool_FromLong( p_priv->b_thread ) );
     PyDict_SetItemString( p_retval, "thread-id",
-                          PyLong_FromLongLong( p_obj->thread_id ) );
+                          PyLong_FromLongLong( p_priv->thread_id ) );
     PyDict_SetItemString( p_retval, "refcount",
-                          PyInt_FromLong( p_obj->i_refcount ) );
-
+                          PyInt_FromLong( p_priv->i_refcount ) );
     return p_retval;
 }
 
@@ -527,14 +528,17 @@ vlcObject_var_list( PyObject *self, PyObject *args )
     PyObject *p_retval;
     Py_ssize_t i_size;
     Py_ssize_t i_index;
+    vlc_object_internals_t *p_priv;
 
-    i_size = VLCSELF->p_object->i_vars;
+    p_priv = vlc_internals( VLCSELF->p_object );
+    i_size = p_priv->i_vars;
     p_retval = PyTuple_New( i_size );
 
+
     for ( i_index = 0 ; i_index < i_size ; i_index++ )
     {
         PyTuple_SetItem( p_retval, i_index,
-                         Py_BuildValue( "s", VLCSELF->p_object->p_vars[i_index].psz_name ) );
+                         Py_BuildValue( "s", p_priv->p_vars[i_index].psz_name ) );
     }
 
     return p_retval;
@@ -715,7 +719,7 @@ static PyTypeObject vlcObject_Type =
     0,                         /*tp_setattro*/
     0,                         /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-    "Expose VLC object infrastructure.\n\nConstructor: vlc.Object(object_id)",  /* tp_doc */
+    "Expose VLC object internal infrastructure.\n\nConstructor: vlc.Object(object_id)\n\nPLEASE BE AWARE that accessing internal features of VLC voids the guarantee for the product and is not advised except if you know what you are doing.",  /* tp_doc */
     0,                     /* tp_traverse */
     0,                     /* tp_clear */
     0,                     /* tp_richcompare */