In order to switch my server implementation from multicast to unicast, I use the following function in my live555 wrapper code to close the current session before re-opening the new session.
void CRTSPWrapper::RemoveSMS() { streamStream_t *stream = m_StreamArray[m_StreamIndex]; if (stream->isMulticast) { Medium::close(stream->rtcp); Medium::close(stream->sink); Medium::close(stream->framedSource); delete stream->rtcpGroupsock; delete stream->rtpGroupsock; } rtspServer->deleteServerMediaSession(stream->sms); stream->iRefCount = 0; stream->sms = NULL; m_RemoveSuccess = 1; } I'm using VLC as the client to test this and I can connect to my server using a multicast url of the form:- rtp://@224.50.87.90:3000 I can also connect using the unicast address form:- rtsp://10.50.87.90:554/stream0 I find, if I have a unicast connection to the server and I call the above code to shut it down, I get a segmentation fault in deleteServerMediaSession. I don't get this crash if I connect only via the multicast addressing method. Digging a bit deeper, I'm finding the crash to be in the (RTSPServer.cpp) reclaimStreamStates() function called from the RTSPClientSession destructor. I suspect fStreamStates[i].subsession is not NULL but not legitimate, but I've no idea why not. It seems that there is no client session to destroy if the rtp multicast address method is used, neither is the reference count incremented in this case. Any advice or help would be appreciated. - David J Myers
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel