[Live-devel] Stopping the server doesn't actually stop
Marlon Reid
Marlon at scansoft.co.za
Wed May 30 07:19:34 PDT 2012
Hi,
I have an application that streams audio from a microphone to other
machines on the network via RTSP. Users control the stream with a
"Start" and "Stop" button. When making the first "call" the quality is
perfect (calls start by clicking "start" and end by clicking "stop").
The second call has some slight noise in it, and the third call is
completely rubbish.
I have discovered that only the first stop actually stops the server
from streaming. The second call's stop, even though it calls the same
function, does not stop the server from streaming. I know this because
my program continuously hits a breakpoint in the AfterGettingFrame
function of my FramedFilter, even though the server is supposed to be
stopped.
My stop function looks like this
//-------------------------------------------------
map<string, COnDemandSubsession*>::iterator itr2;
itr2 = m_odsList.find(streamID);
if (itr2 == m_odsList.end())
return false;
m_odsList.erase(itr2);
map<string, ServerMediaSession*>::iterator itr;
itr = m_smsList.find(streamID);
if (itr == m_smsList.end())
return false;
m_rtspServer->removeServerMediaSession((*itr).second);
m_smsList.erase(itr);
//--------------------------------------------------
The first thing it does is look up the OnDemandSubsession for this
stream by my streamID, then I erase it from the list. After that I
lookup the ServerMediaSession based on the streamID, remove it from the
RTSP server and erase it from the list. This procedure works well for
the first call's stop, but it seems to fail for the second call's stop (
As I mentioned before, I know this because my program still enters
AfterGettingFrame).
Could the problem be that I am not deleting the OnDemandSubsession and
ServerMediaSession? I tried that but then Live555 crashes in
RTSPServer::RTSPCLientSession::reclaimStreamStates(), so I assumed that
those are deleted in Live555 and should not be deleted in my code.
Once again I need some advice. Why does the server not actually stop on
the second call's stop? Thank you for all you assistance.
Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120530/8e5036f2/attachment-0001.html>
More information about the live-devel
mailing list