[vlc-devel] [PATCH] vout/macos: don't unload library

Rémi Denis-Courmont remi at remlab.net
Tue Nov 28 17:19:28 CET 2017


Le tiistaina 28. marraskuuta 2017, 16.08.06 EET Pierre Lamot a écrit :
> On mardi 28 novembre 2017 14:49:00 CET Rémi Denis-Courmont wrote:
> > While you shouldn't rely on it, the module only gets unloaded when LibVLC
> > exits. This is too late to run the UI main loop.
> 
> My use case is people releasing the media player and libvlc from the UI
> thread, for instance while destroying their main window. So the module is
> closed, lib is released and the main loop still exists.

That is irrelevant because running VLC plugin code after LibVLC is destroyed 
is a big NO NO. Hence retaining the code after LibVLC is pointless.

In fact, LibVLC media player API more or less explicitly warrants that nothing 
will happen after libvlc_media_player_stop() has returned.

> If we can only create/release libvlc from outside UI loops, I think it
> should be clearly stated in the doc.

There is no such restrictions.

You can´t use libvlc functions from libvlc event callbacks, and you must 
ensure use by a single thread at a time for any given object. That´s all.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list