examples: webrtc: mp-sendrecv: set element states to NULL after removing them from...
authorSam Van Den Berge <sam.van.den.berge@gmail.com>
Tue, 18 Oct 2022 13:27:20 +0000 (15:27 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 19 Oct 2022 00:51:44 +0000 (00:51 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3219>

subprojects/gst-examples/webrtc/multiparty-sendrecv/gst/mp-webrtc-sendrecv.c

index c7b2d25..ff45996 100644 (file)
@@ -308,6 +308,7 @@ remove_peer_from_pipeline (const gchar * peer_id)
     return;
 
   gst_bin_remove (GST_BIN (pipeline), webrtc);
+  gst_element_set_state (GST_ELEMENT (webrtc), GST_STATE_NULL);
   gst_object_unref (webrtc);
 
   qname = g_strdup_printf ("queue-%s", peer_id);
@@ -321,6 +322,7 @@ remove_peer_from_pipeline (const gchar * peer_id)
   gst_object_unref (sinkpad);
 
   gst_bin_remove (GST_BIN (pipeline), q);
+  gst_element_set_state (GST_ELEMENT (q), GST_STATE_NULL);
   gst_object_unref (q);
 
   tee = gst_bin_get_by_name (GST_BIN (pipeline), "audiotee");