<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></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=""><div bgcolor="#FFFFFF" text="#000000" class=""><blockquote cite="mid:106DC8AD-9B43-485F-9B94-5C374F38FF37@live555.com" type="cite" class=""><div class="">The usual way to do this sort of thing - within the LIVE555
        event loop - is to call</div>
      <div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>TaskScheduler::scheduleDelayedTask()</div>
      <div class="">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.</div>
    </blockquote>
    <br class="">
    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…</div></div></blockquote><div><br class=""></div>Sigh…  There’s your problem right there.</div><div><br class=""></div><div>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.</div><div><br class=""></div><div>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.</div><div><br class=""></div><div>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.</div><br class=""><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>