rtsp-client: cleanup transports during TEARDOWN
authorBranko Subasic <branko@axis.com>
Fri, 22 Jan 2021 07:58:23 +0000 (08:58 +0100)
committerBranko Subasic <branko@axis.com>
Fri, 22 Jan 2021 15:42:00 +0000 (16:42 +0100)
commit2894640cc5a796eb27e5605b3932523bd1ab5982
tree70071cba2132265b7db2f4964f527f053f863220
parentac5213dcdf09f95c71329005a865a39867c3e7c1
rtsp-client: cleanup transports during TEARDOWN

When tunneling RTP over RTSP the stream transports are stored in a hash
table in the GstRTSPClientPrivate struct. They are used for, among other
things, mapping channel id to stream transports when receiving data from
the client. The stream tranports are created and added to the hash table
in handle_setup_request(), but unfortuately they are not removed in
handle_teardown_request(). This means that if the client sends data on
the RTSP connection after it has sent the TEARDOWN, which is often the
case when audio backchannel is enabled, handle_data() will still be able
to map the channel to a session transport and pass the data along to it.
Which eventually leads to a failing assert in gst_rtsp_stream_recv_rtp()
because the stream is no longer joined to a bin.
We avoid this by removing the stream transports from the hash table when
we handle the TEARDOWN request.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/184>
gst/rtsp-server/rtsp-client.c