Skip to content

rtmp2sink: fix socket leak and not closed on publish error

When the start_publish_async() fails (for instance cause the stream is already published) the already existing GstRtmpConnection is lost as it is not assigned to the GstRtmp2Sink instance (as it is when no error occurred)

The result is that after the main loop exit (in gst_rtmp2_sink_task_func()) , self->connection is NULL and the gst_rtmp_connection_close_and_unref() is not called. Apart from the memory leak, the socket stays in CLOSE_WAIT until process is closed.

Merge request reports