diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2020-09-23 15:25:36 -0400 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-10-04 20:51:38 +0100 |
commit | 5888def8838df9ada8443d2972864b685c666591 (patch) | |
tree | 7c69d4cf7437708fe93a4cfea1d7ef816db33646 | |
parent | e72bbb9d65435d44432c35fdb7c61a339b5434fd (diff) | |
download | gstreamer-plugins-good-5888def8838df9ada8443d2972864b685c666591.tar.gz |
rtpbin: Remove the rtpjitterbuffer with the stream
Since !348, the jitterbuffer was only removed with the session. This restores
the original behaviour and removes the jitterbuffer when the stream is
removed. This avoid accumulating jitterbuffer objects into the bin when a
session is reused.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/765>
-rw-r--r-- | gst/rtpmanager/gstrtpbin.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index bdb16a0a3..1fb98ffc7 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -859,6 +859,7 @@ free_session (GstRtpBinSession * sess, GstRtpBin * bin) g_slist_foreach (sess->elements, (GFunc) remove_bin_element, bin); g_slist_free (sess->elements); + sess->elements = NULL; g_slist_foreach (sess->streams, (GFunc) free_stream, bin); g_slist_free (sess->streams); @@ -1849,6 +1850,7 @@ no_demux: static void free_stream (GstRtpBinStream * stream, GstRtpBin * bin) { + GstRtpBinSession *sess = stream->session; GSList *clients, *next_client; GST_DEBUG_OBJECT (bin, "freeing stream %p", stream); @@ -1875,7 +1877,10 @@ free_stream (GstRtpBinStream * stream, GstRtpBin * bin) if (stream->buffer_ntpstop_sig) g_signal_handler_disconnect (stream->buffer, stream->buffer_ntpstop_sig); + sess->elements = g_slist_remove (sess->elements, stream->buffer); + remove_bin_element (stream->buffer, bin); gst_object_unref (stream->buffer); + if (stream->demux) gst_bin_remove (GST_BIN_CAST (bin), stream->demux); |