[Live-devel] Live555 RTSP Client never sees RTCP BYE message from Live555 Server

Matt Schuckmann matt at schuckmannacres.com
Thu Mar 12 11:22:38 PDT 2009


Did you actually read what I said: it's in the line you quoted below
When the *TEARDOWN* message is sent by the client to the server and the 
server is shutting down the session the server does not successfully 
send a BYE message and it appears that it should. This *is* the behavior 
is regardless if it's a file with a known duration or a live feed. 
You've coded it to try to send a BYE message and the RTP spec says when 
a participant leaves a session a BYE packet should be sent and I'd say 
that the server responding to a TEARDOWN message and shutting down the 
session constitutes leaving a session.
The afterPlayingStreamState() method is not called in the case of a 
TEARDOWN, it appears that it is only called as a indirect result of 
calling handleClosure() on the FramedSource.

I have now tested this with the 1/26/2009 release without modifications 
and the behavior I describe is the case for the release code.
Here is what I did:
On one system I ran the TestOnDemandRTSPServer application serving up a 
mpg file.
On another system I ran openRTSP with the command openRTSP -m 
rtsp//paine:8554/mepg1or2AudioVideoTest
I ran a network sniffer (WireShark) on both the server and the client 
systems.
After letting the client receive a few seconds I made the client 
shutdown so that shutdown() in playCommon.cpp is called, this causes a 
TEARDOWN to be sent to the server. (did this by adding Ctrl+c signal 
handling to PlayCommon.cpp for the windows build)

I inspected the traffic in WireShark and noted that the client sends a 
BYE message but the server does not.
I also noted that the client did not print out the message that a BYE 
handler was received.
Therefore we can conclude that the server does not send BYE messages on 
receipt of a TEARDOWN message. By inspecting the code, as I described 
before, it appears that you intended the server to send a BYE messages 
on a TEARDOWN. Furthermore, the RTP spec indicates that a participant 
should send a BYE message when it leaves a session, I believe that this 
is regardless of the reason for leaving the session.

Matt S.

Ross Finlayson wrote:
>> I'm pretty sure that this would happen with unmodified code, just see 
>> if your bye handler is called in OpenRTSP after sending or a teardown 
>> message while the source is still playing.
>
> It is, *provided that* the original source file does not have a known 
> duration.  When streaming from a live source, or from a file for which 
> the server does not know the duration, the server sends a RTCP "BYE" 
> packet when the input source ends.
>
> However, when streaming from a file for which the server knows the 
> file's duration (currently, MP3, .MPG, .TS and .AVI files), the server 
> *does not* send a RTCP "BYE" packet when it reaches the end of the 
> file.  The reason for this is to keep the stream alive, and therefore 
> allow the client - if it desires - to continue playing the file, by 
> seeking back within it and replaying from an earlier time. Because - 
> in this case - the client was told the stream's duration beforehand, 
> it doesn't need to see a RTCP "BYE" in order to know when it ends.
>
> Note the code for the function "afterPlayingStreamState()" in 
> "liveMedia/OnDemandServerMediaSubsession.cpp".
>
> And yes, I've tested this on the installed code.
>
> If you suspect a bug in the code, then please test this using the 
> original, released code; not your modifications to the code.


More information about the live-devel mailing list