<div>I tried to solve the problem, and got the following results (I have dll library with live555 code and host application that used this library):</div><div>- I have no media sessions, launch and run empty server. Start and stop are OK. Media::close(rtspServer) runs with no errors. Next server starts also OK.</div>
<div>- I have one or more media sessions (from camera stream). First launch is OK. Players (vlc for example) are connected to proxy and played successfully. If we have no clients and try call Medium::close for rtsp server, there is exception in RTCP.cpp:240 (2012.11.22 version). Callstack:</div>
<div><span class="" style="white-space:pre">       "</span>live555proxyDLLNative.dll!RTCPInstance::setByeHandler(void (void *)* handlerTask, void * clientData, bool handleActiveParticipantsOnly) šLine 240 + 0x6 bytes<span class="" style="white-space:pre">    </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!ProxyServerMediaSubsession::~ProxyServerMediaSubsession() šLine 342<span class="" style="white-space:pre">     </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!ProxyServerMediaSubsession::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">     </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!ServerMediaSession::deleteAllSubsessions() šLine 195 + 0xc bytes<span class="" style="white-space:pre">        </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!ServerMediaSession::~ServerMediaSession() šLine 84<span class="" style="white-space:pre">      </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!ProxyServerMediaSession::~ProxyServerMediaSession() šLine 93 + 0xf bytes<span class="" style="white-space:pre">        </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!ProxyServerMediaSession::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">        </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTSPServer::removeServerMediaSession(ServerMediaSession * serverMediaSession) šLine 74 + 0x9 bytes<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTSPServer::~RTSPServer() šLine 260<span class="" style="white-space:pre">     </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!RTSPServer::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">     </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!DoLoop() šLine 50 + 0xc bytes<span class="" style="white-space:pre">   </span>C++"</div>
<div><br></div><div><div>If we have clients and try call Medium::close for rtsp server, there is exception in RTSPClient.cpp:1205 (2012.11.22 version). Callstack:</div></div><div>š š š š"live555proxyDLLNative.dll!RTSPClient::handleAlternativeRequestByte1(unsigned char requestByte) šLine 1205 + 0x27 bytes<span class="" style="white-space:pre"> </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTSPClient::handleAlternativeRequestByte(void * rtspClient, unsigned char requestByte) šLine 1196<span class="" style="white-space:pre">       </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!SocketDescriptor::~SocketDescriptor() šLine 348 + 0x14 bytes<span class="" style="white-space:pre">    </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!SocketDescriptor::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">       </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!SocketDescriptor::deregisterRTPInterface(unsigned char streamChannelId) šLine 391 + 0x20 bytes<span class="" style="white-space:pre">  </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!deregisterSocket(UsageEnvironment & env, int sockNum, unsigned char streamChannelId) šLine 159<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTPInterface::stopNetworkReading() šLine 274 + 0x1d bytes<span class="" style="white-space:pre">       </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!RTCPInstance::~RTCPInstance() šLine 185<span class="" style="white-space:pre"> </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTCPInstance::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">   </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaSubsession::deInitiate() šLine 807 + 0xf bytes<span class="" style="white-space:pre">     </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!MediaSubsession::~MediaSubsession() šLine 602<span class="" style="white-space:pre">   </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaSubsession::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">        </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!MediaSession::~MediaSession() šLine 82 + 0x23 bytes<span class="" style="white-space:pre">     </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaSession::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">   </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!ProxyServerMediaSession::~ProxyServerMediaSession() šLine 91 + 0xc bytes<span class="" style="white-space:pre">        </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!ProxyServerMediaSession::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">        </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!RTSPServer::removeServerMediaSession(ServerMediaSession * serverMediaSession) šLine 74 + 0x9 bytes<span class="" style="white-space:pre">      </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!RTSPServer::~RTSPServer() šLine 260<span class="" style="white-space:pre">     </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!RTSPServer::`scalar deleting destructor'() š+ 0xf bytes<span class="" style="white-space:pre">     </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!MediaLookupTable::remove(const char * name) šLine 152 + 0x21 bytes<span class="" style="white-space:pre">      </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!Medium::close(UsageEnvironment & env, const char * name) šLine 54<span class="" style="white-space:pre">   </span>C++</div>
<div>š<span class="" style="white-space:pre">   </span>live555proxyDLLNative.dll!Medium::close(Medium * medium) šLine 59 + 0x17 bytes<span class="" style="white-space:pre">    </span>C++</div><div>š<span class="" style="white-space:pre">       </span>live555proxyDLLNative.dll!DoLoop() šLine 50 + 0xc bytes<span class="" style="white-space:pre">   </span>C++"</div>
<div><div><br></div><div>I was mistaken in this thread <a href="http://lists.live555.com/pipermail/live-devel/2012-November/016105.html">http://lists.live555.com/pipermail/live-devel/2012-November/016105.html</a>. Problem is saved here.</div>
</div><div>Library source:š<a href="http://pastebin.com/FKrFX1wa">http://pastebin.com/FKrFX1wa</a></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/28 óĹŇÇĹĘ âÁÓÔŇÁËĎ× <span dir="ltr"><<a href="mailto:shaman.lab.x11@gmail.com" target="_blank">shaman.lab.x11@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>This parts of code are in different functions.<br>
"env->taskScheduler().doEventLoop(&done);" called in dll's function in other thread,š "done = ~0; is in stop function. With doEventLoop return I have no problem.</p>
<div class="gmail_quote">28.11.2012 5:47 ĐĎĚŘÚĎ×ÁÔĹĚŘ "Ross Finlayson" <<a href="mailto:finlayson@live555.com" target="_blank">finlayson@live555.com</a>> ÎÁĐÉÓÁĚ:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">

<div style="word-wrap:break-word"><div><blockquote type="cite"><div>"if (env!=NULL)</div><div><span style="white-space:pre-wrap">  </span>env->taskScheduler().doEventLoop(&done);"</div><div>"done = ~0;</div>


</blockquote><div><br></div></div>The "doEventLoop()" function does not return *until* the variable "done" is set to some non-zero value, so if the value of "done" is zero before you call "doEventLoop()", then that call will never return (and so you will never get to the statement "done = ~0;").<div>


<br></div><div>If you want to leave the event loop (using this method), then you will need to set "done = ~0;" either</div><div><span style="white-space:pre-wrap">     </span>- within the event loop (i.e., when you handle a LIVE555 event), or</div>


<div><span style="white-space:pre-wrap">  </span>- from a different thread.</div><br><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">Ross Finlayson<br>


Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br></div><br></div></div>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div>
</blockquote></div><br></div>