[Live-devel] Setting StreamState referenceCount
jers at inwind.it
jers at inwind.it
Wed Nov 8 01:44:06 PST 2006
Hi all,
Im carrying out a streaming server based on the Live library. My media subsession is similar to the MPEG4VideoFileServerMediaSubsession but my source implements an onClosure method that informs the subsession about the end of the playing and causes the closure of RTP and RTCP connections with the client. Moreover, the reuse flag is set, so a single source is used for more RTSP clients.
Suppose we have two clients streaming the same source, i.e. StreamState::fReferenceCount defined in OnDemandServerMediaSubsession file is 2. If the source ends, the static afterPlayingStreamState function (defined in the same file) calls the StreamState::reclaim() which sets to zero the fReferenceCount, although 2 clients still have an active RTSP connection. At this state, the players show a fix image. When these RTSP clients send their teardowns to the server, the RTSP server goes in fault. In particular, the first teardown is normally managed.
- The RTSPServer::RTSPClientSession::handleCmd_TEARDOWN sets the RTSPClientSession::fSessionIsActive to false.
- So, the RTSPServer::RTSPClientSession::incomingRequestHandler1 deletes theRTSPClientSession.
- The RTSPClientSession destructor leads to the OnDemandServerMediaSubsession::deleteStream which finds that fReferenceCount is zero, and so deletes the streamState
In the same way, when the second teardown is received, the OnDemandServerMediaSubsession::deleteStream try to delete the streamState that is already deleted, and so it goes in segmentation fault.
To fix this problem I suggest to remove the line 501 in file OnDemandServerMediaSubsession.cpp that sets to zero the StreamState::fReferenceCount.
What do you think about that?
Thanks. Bye
Jers
------------------------------------------------------
Scopri il nuovo MOTOROLA K1, il cellulare con superficie frontale a specchio. Se sarai fortunato potrai anche vincerne uno! Clicca e vinci !
http://click.libero.it/motorola8nov
More information about the live-devel
mailing list