Page 1 of 1

Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 19:52
by sherington
A libvlc_video_viewpoint_t is created by libvlc_video_new_viewpoint():

Code: Select all

LIBVLC_API libvlc_video_viewpoint_t *libvlc_video_new_viewpoint(void);

IIRC this used to be able to be freed by libvlc_free, but as libvlc_free has been removed what now is the correct thing to do here?

Should there be a corresponding libvlc_video_viewpoint_destroy(libvlc_video_viewpoint_t*) or something?

I should not be just calling the standard native free() on memory that LibVLC allocated should I?

Re: Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 19:53
by Rémi Denis-Courmont
libvlc_free() is useless as you can call free(). LibVLC uses malloc().

Re: Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 19:58
by sherington
I'm fine with that, thanks, I can call a native free.

It just seemed like maybe it's something that would be better encapsulated, other native API in LibVLC has destroy counterparts that's what prompted my question.

Re: Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 20:35
by Rémi Denis-Courmont
For opaque LibVLC types, there should be probably a type-specific destructor function, yes.

Re: Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 21:19
by mfkl
You didn't mention which version of libvlc you are using.

Both latest libvlc 3 and libvlc 4 have libvlc_free again, so update.

Re: Freeing a libvlc_video_viewpoint_t

Posted: 10 Apr 2020 21:43
by sherington
Ah, I remember the mailing list discussion but didn't realise this was added back in.

Thanks for the suggestion.