rtmpsrc: Slow teardown of connection when pipeline is interrupted
Submitted by John Slade
Link to original bug (#755732)
Description
The RTMP plugin can be slow to stop when interrupted (with SIGINT) as it waits for the network socket to timeout before stopping. librtmp has this timeout set by default at 30 seconds.
Here is an example output with timestamps:
Sep 25 16:38:13 Setting pipeline to PAUSED ...
Sep 25 16:38:13 Pipeline is PREROLLING ...
Sep 25 16:38:15 Redistribute latency...
Sep 25 16:38:15 Pipeline is PREROLLED ...
Sep 25 16:38:15 Setting pipeline to PLAYING ...
Sep 25 16:38:15 New clock: GstSystemClock
Sep 25 16:38:16 handling interrupt. <-------------- interrupt with SIGINT
Sep 25 16:38:16 Interrupt: Stopping pipeline ...
Sep 25 16:38:16 Execution ended after 0:00:00.951296656
Sep 25 16:38:16 Setting pipeline to PAUSED ...
Sep 25 16:38:16 Setting pipeline to READY ...
Sep 25 16:38:46 Setting pipeline to NULL ... <-------------- 30 seconds delay
Sep 25 16:38:46 Freeing pipeline ...
The log shows going from READY->NULL took 30 seconds.