]> git.sesse.net Git - vlc/blobdiff - src/libvlc.h
Use asprintf instead of malloc+sprintf (and check the return value)
[vlc] / src / libvlc.h
index e0e9e8603f10cb6150892bb33d81712b9ef6b671..e9ec933cd8223153bf83ba1aab817afecb22633a 100644 (file)
@@ -138,8 +138,10 @@ char *vlc_fix_readdir (const char *);
  * @return the created object, or NULL.
  */
 extern void *
-vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
-                   const char *psz_type);
+__vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
+                     const char *psz_type);
+#define vlc_custom_create(o, s, t, n) \
+        __vlc_custom_create(VLC_OBJECT(o), s, t, n)
 
 /**
  * libvlc_global_data_t (global variable)
@@ -220,6 +222,8 @@ vlc_object_signal_maybe (vlc_object_t *p_this)
  */
 typedef struct libvlc_priv_t
 {
+    libvlc_int_t       public_data;
+
     /* Configuration */
     vlc_mutex_t        config_lock; ///< config file lock
     char *             psz_configfile;   ///< location of config file
@@ -261,7 +265,7 @@ typedef struct libvlc_priv_t
 
 static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
 {
-    return (libvlc_priv_t *)(libvlc + 1);
+    return (libvlc_priv_t *)libvlc;
 }
 
 void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );