[vlc-commits] commit: Revert "Remove libvlc_free" ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sat Oct 2 17:55:05 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct  2 18:54:53 2010 +0300| [57a4f916876060dc51583f40483522a0ad1de8bc] | committer: Rémi Denis-Courmont 

Revert "Remove libvlc_free"

This reverts commit 61f0547b72d3ba80039f09064249d89fa8f2b0f7.

Conflicts:

	include/vlc/libvlc.h

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

 include/vlc/libvlc.h              |    8 ++++++++
 include/vlc/libvlc_media_player.h |    2 +-
 src/control/core.c                |    5 +++++
 src/libvlc.sym                    |    1 +
 4 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 8541768..5b8c265 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -226,6 +226,14 @@ VLC_PUBLIC_API const char * libvlc_get_compiler(void);
  */
 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
 
+/**
+ * Frees an heap allocation returned by a LibVLC function.
+ * If you know you're using the same underlying C run-time as the LibVLC
+ * implementation, then you can call ANSI C free() directly instead.
+ *
+ * \param ptr the pointer
+ */
+VLC_PUBLIC_API void libvlc_free( void *ptr );
 
 /** \defgroup libvlc_event LibVLC asynchronous events
  * LibVLC emits asynchronous events.
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index e8fe7a7..105090e 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -735,7 +735,7 @@ VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f
  *
  * \param p_mi the media player
  * \return the video aspect ratio or NULL if unspecified
- * (the result must be released with free()).
+ * (the result must be released with free() or libvlc_free()).
  */
 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
 
diff --git a/src/control/core.c b/src/control/core.c
index 1411e9c..745c85a 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -159,3 +159,8 @@ const char * libvlc_get_changeset(void)
     extern const char psz_vlc_changeset[];
     return psz_vlc_changeset;
 }
+
+void libvlc_free( void *ptr )
+{
+    free( ptr );
+}
diff --git a/src/libvlc.sym b/src/libvlc.sym
index f635a68..363faff 100644
--- a/src/libvlc.sym
+++ b/src/libvlc.sym
@@ -32,6 +32,7 @@ libvlc_event_manager_register_event_type
 libvlc_event_manager_release
 libvlc_event_send
 libvlc_event_type_name
+libvlc_free
 libvlc_get_changeset
 libvlc_get_compiler
 libvlc_get_fullscreen



More information about the vlc-commits mailing list