[vlc-devel] request for review: add callback variable to interfaces to know when to shutdown
Rémi Denis-Courmont
rem at videolan.org
Sun Oct 12 21:00:13 CEST 2008
Le dimanche 12 octobre 2008 21:21:52 Ilkka Ollakka, vous avez écrit :
> Attached patch is one way to overcome interface for looping and checking
> when it should die. I would appreciate if courmisch/pdherbemont/j-b/
> someone working with interface and/or core could take a look and comment
> if something is totally wrong (like causing infinite loop/small black
> holes), or if this approach is some otherway not quite right.
IMHO, the interface should simply exit when Close() is called. It does not
need yet another abuse of the variables subsystem. The interface can start
its thread(s) manually from Open(). This should anyway be done if the
interface needs to wait for its thread initialization. I believe Qt4 should
do that, to ensure that dialogs and vout windows are not invoked while the
interface is still initializing.
Inside Close(), the interface can notify its thread in any convenient
interface-specific way. For instance, a Qt4 signal can be emitted.
An alternative is to not pre-empt thread cancellation. intf_Destroy() will
cancel the "pf_run" thread. A few simple interfaces are leveraging this
already in trunk.
--
Rémi Denis-Courmont
http://git.remlab.net/cgi-bin/gitweb.cgi?p=vlc-courmisch.git;a=summary
More information about the vlc-devel
mailing list