[Live-devel] How to safely close the openRtsp?

Ross Finlayson finlayson at live555.com
Fri Dec 23 23:39:09 PST 2011


>         The openRtsp has designed to be close  rudely by the CTRL+C or console windows's close button.

There's nothing "rude" about terminating a process; a process doesn't have feelings.

The only problem with simply terminating a process that's acting as a RTSP client is that it will not stop the server from continuing to transmit the stream's data.  (Eventually, the server will usually 'time out' the stream, because of lack of 'liveness' by the client, but it will continue to transmit data in the meantime.)  So ideally you should also send a RTSP "TEARDOWN" command to the client, telling it to stop streaming.

If your RTSP client is a standalone process (like "openRTSP"), then all you need to do is close the output 'sink' objects (e.g., output files), and then send a RTSP "TEARDOWN" command.  Then you can just call "exit()" to terminate the process.

If, however, your RTSP client is part of an application that you (for whatever reason) do not want to terminate, then you have to do more.  For guidance, I suggest that you look at the new "testRTSPClient" application (*not* the "openRTSP" code) - in particular, the implementation of the "shutdownStream()" function.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111223/1c0c753a/attachment.html>


More information about the live-devel mailing list