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 fa0d74966e.

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Signed-off-by: David Fuhrmann <dfuhrmann@videolan.org>
Signed-off-by: Denis Charmet <typx@videolan.org>
This commit is contained in:
Thomas Guillem 2019-05-28 14:01:05 +02:00
parent 80ea20b275
commit 4d75329c8f
4 changed files with 16 additions and 1 deletions

View File

@ -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.
*

View File

@ -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 );

View File

@ -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 )
{

View File

@ -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