[vlc-commits] Revert "Remove libvlc_free"
Thomas Guillem
git at videolan.org
Tue May 28 14:10:01 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May 28 14:01:05 2019 +0200| [4d75329c8fafb7423a1535407d432b542619eb38] | committer: Thomas Guillem
Revert "Remove libvlc_free"
As decided by the VLC TC.
- 4 in favor: David, Denis, Hugo, Thomas
- 1 against: Rémi
cf. discussion here https://mailman.videolan.org/pipermail/vlc-devel/2019-May/124752.html
This reverts commit fa0d74966e6338fc66b3b59120c2923b7fd6ae5f.
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>
Signed-off-by: Denis Charmet <typx at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d75329c8fafb7423a1535407d432b542619eb38
---
include/vlc/libvlc.h | 9 +++++++++
include/vlc/libvlc_media_player.h | 2 +-
lib/core.c | 5 +++++
lib/libvlc.sym | 1 +
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 0ec0045c96..1c2550fe3b 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -277,6 +277,15 @@ LIBVLC_API const char * libvlc_get_compiler(void);
*/
LIBVLC_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
+ */
+LIBVLC_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 1b7547cfb8..10e302529d 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1491,7 +1491,7 @@ LIBVLC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_fac
*
* \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()).
*/
LIBVLC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
diff --git a/lib/core.c b/lib/core.c
index 6edf14b154..06fd52fbfa 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -151,6 +151,11 @@ const char * libvlc_get_changeset(void)
return psz_vlc_changeset;
}
+void libvlc_free( void *ptr )
+{
+ free( ptr );
+}
+
static libvlc_module_description_t *module_description_list_get(
libvlc_instance_t *p_instance, const char *capability )
{
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 99600d1f63..67b8efcba0 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -49,6 +49,7 @@ libvlc_dialog_set_callbacks
libvlc_dialog_set_context
libvlc_event_attach
libvlc_event_detach
+libvlc_free
libvlc_get_changeset
libvlc_get_compiler
libvlc_get_fullscreen
More information about the vlc-commits
mailing list