[vlc-devel] [PATCH] Handle GET_PARAMETER keepalive responses during PAUSE
Paul Clark
paul at packetship.com
Thu Jun 25 11:39:52 CEST 2015
On 24/06/15 20:57, Ross Finlayson wrote:
>>> Ensuring provable thread-safety
>>> of this stuff is beyond my understanding of VLC internals I'm afraid.
>>
>> I believe the patch makes crashes much more likely though. That being
>> said, I
>> do not maintain this particular VLC plugin. Its maintainer(s) should
>> decide on
>> what to do.
>
> I’m not responsible for, or familiar with, VLC’s LIVE555 interface
> code (“live555.cpp”) either. I just wanted to make clear, however,
> that the way that application code that calls LIVE555 is *supposed* to
> be written is that only one thread (the ‘LIVE555 event loop thread’)
> is ever supposed to call functions in the LIVE555 library (including
> “sendPauseCommand()”, “sendGetParameterCommand()”, and
> “sendPlayCommand()”). The reason for this is LIVE555-based
> applications run in a single thread of control, using an event loop -
> rather than multiple threads - for concurrency. (For a longer
> discussion of this, see the LIVE555 FAQ.)
Thanks Ross for the detailed and very apposite reminder... Yes, I think
the original author(s) of live555.cpp understood this and attempted to
ensure only one thread could call any LIVE555 function at once through a
shared flag variable. There is of course a race condition here and as
Rémi says, my patch unfortunately makes this more likely...
The problem arises because the Demux() function of the module that
usually does the GET_PARAMETER is not called while the stream is paused,
so another thread was created to do it. Maybe the core VLC developers
can point me to another mechanism for getting regular flow-of-control
within the main thread - some kind of Tick() function - which could be
used to send the GET_PARAMETER independently of whether it is paused or not?
I'm hoping, BTW, that Demux() and Control() are always called in the
same thread? If not we have much bigger problems, since both send RTSP
commands and call doEventLoop()...
I guess other alternative would be to synchronise all calls to Live555
in a big fat mutex lock... Is that doable / sensible?
Best regards
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150625/67ac25f4/attachment.html>
More information about the vlc-devel
mailing list