<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><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.)<div class=""><br class=""></div><div class="">So, I hope that this is true in whatever changes you are proposing for “live555.cpp”: Only the ‘LIVE555 event loop’ thread is supposed to be calling LIVE555 library functions. Where this gets complicated is in applications - like VLC - that have their own, separate ‘event’ mechanism as well.</div><div class=""><br class=""></div><div class="">The way that people usually handle this (no pun intended) is to continue to have one thread running the LIVE555 event loop, but use other thread(s) to ‘signal' to the LIVE555 event loop that there are LIVE555 events that it needs to handle. There are two common ways in which this is done:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>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). (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.)</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>2/ Use LIVE555’s ‘event trigger’ mechanism, which is a more sophisticating way of signaling the LIVE555 event loop from an external thread. 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()”. (This is the only LIVE555 function that may be called from an external thread.)</div><div class=""><br class=""></div><div class="">I hope this helps.</div><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Ross Finlayson<br class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>