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

Ross Finlayson finlayson at live555.com
Thu Jun 25 16:56:57 CEST 2015


>> The usual way to do this sort of thing - within the LIVE555 event loop - is to call
>>  TaskScheduler::scheduleDelayedTask()
>> to periodically schedule a task that sends the “GET_PARAMETER” command (and then calls "TaskScheduler::scheduleDelayedTask()” again).  If you move the call to “sendGetParameterCommand()” from the “Demux()” function to this new handler task, then that should solve your problem - and all LIVE555 functions will continue to be called only from the LIVE555 event loop thread, as they should.
> 
> Yes, that could work, or if there was a regular safe flow of control it would be trivial to just have a timer check in the live555.cpp code to do it.  The problem in both cases is nothing is calling doEventLoop() while the stream is paused…

Sigh…  There’s your problem right there.

Once again, folks: The best way to use the LIVE555 library is to have *exactly one* thread that calls LIVE555 functions.  This thread (after some initialization to set up timer tasks using “scheduleDelayedTask()”) would call “doEventLoop()”, without a 'watch variable' parameter.  In other words, this thread would do nothing but run within “doEventLoop()”, and would not block.  Your other threads (i.e., the rest of your application) can continue to do whatever they want - except call LIVE555 functions.

This is the way that the LIVE555 library is intended to be used, and it’s how almost everyone else has been using it.  Unfortunately, however, you have chosen a different model - in which you make ‘temporary' calls into the LIVE555 library.  This complicates your code, because (1) you need to ensure that no more than one thread of control at a time is calling LIVE555 functions, and (2) because you need to use a ‘watch variable’ in each of your calls to “doEventLoop()”, to ensure that the calls are temporary.

That’s why your “live555.cpp” code is so complex.  I urge you to (sometime in the future) restructure this code - as noted above - to use a single thread that does nothing but run inside “doEventLoop()”.  This would simplify it considerably.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150625/d089ec9d/attachment.html>


More information about the vlc-devel mailing list