<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 24/06/15 20:57, Ross Finlayson wrote:<br>
<blockquote
cite="mid:A8A81414-6BE8-4F54-8437-3DEB0DCEB42D@live555.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div>
<blockquote type="cite" class="">
<div class="">
<blockquote type="cite" style="font-family: Helvetica;
font-size: 14px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent:
0px; text-transform: none; white-space: normal; widows:
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">Ensuring provable thread-safety<span
class="Apple-converted-space"> </span><br class="">
of this stuff is beyond my understanding of VLC internals
I'm afraid.<br class="">
</blockquote>
<br style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
<span style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px; float:
none; display: inline !important;" class="">I believe the
patch makes crashes much more likely though. That being
said, I<span class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
<span style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px; float:
none; display: inline !important;" class="">do not
maintain this particular VLC plugin. Its maintainer(s)
should decide on<span class="Apple-converted-space"> </span></span><br
style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
<span style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px; float:
none; display: inline !important;" class="">what to do.</span><br
style="font-family: Helvetica; font-size: 14px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
</div>
</blockquote>
<div><br class="">
</div>
</div>
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.)</blockquote>
<br>
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...<br>
<br>
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?<br>
<br>
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()...<br>
<br>
I guess other alternative would be to synchronise all calls to
Live555 in a big fat mutex lock... Is that doable / sensible?<br>
<br>
Best regards<br>
<br>
Paul<br>
<br>
<br>
<br>
</body>
</html>