[Live-devel] RTSP Server Crash when switching from multicast to unicast

david.myers at panogenics.com david.myers at panogenics.com
Mon Apr 27 05:52:35 PDT 2015


 

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 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150427/114e8516/attachment.html>


More information about the live-devel mailing list