[vlc-devel] [PATCH] Handle GET_PARAMETER keepalive responses during PAUSE

Rémi Denis-Courmont remi at remlab.net
Wed Jun 24 22:25:51 CEST 2015


Le mercredi 24 juin 2015, 12:57:43 Ross Finlayson a écrit :
> (...) 1/ Use a
> ‘watch variable’ as a parameter to the LIVE555 “doEventLoop()” call.  If
> this ‘watch variable’ is ever set (externally) to a non-zero value, then
> the LIVE555 thread will return from the call to “doEventLoop()” (and
> presumably call “doEventLoop()” again later).

That can only work if the value is set in the same thread, in other words from 
a callback within the event loop. That also requires that the event loop 
somehow wakes up and re-evaluate the variable.

> (I see that you do this
> already in “live555.cpp”.  I notice, however, that you call “doEventLoop()”
> in two places, with two different ‘watch variables’.  Be sure that the
> external VLC thread(s) (that set the ‘watch variable’) knows which 'watch
> variable’ is being used at an given time.)

You are not making no sense here. Considering the current BasicTaskScheduler0 
class implemention of doEventLoop(), only the thread calling doEventLoop() can 
set the watch variable.

> 2/ Use LIVE555’s ‘event trigger’
> mechanism, which is a more sophisticating way of signaling the LIVE555
> event loop from an external thread.

That makes no sense either. The current implementation of BasicTaskScheduler0 
class implementation of triggerEvent() can only be used from the thread that 
runs the main loop *or* while the main loop is not running.

In fact, that seems rather useless.

> With this mechanism, an ‘event
> trigger’ object (and handler) is created within the LIVE555 event loop, and
> then - to signal the event - an external thread calls “triggerEvent()”.

With a custom TaskScheduler child class, maybe. But the built-in "basic" 
live555 implementation is not thread-safe. FWIW, that violates the 
documentation.

> (This is the only LIVE555 function that may be called from an external
> thread.)
> 
> I hope this helps.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list