rtpjitterbuffer test: Stop jitterbuffer before pads to avoid race
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Fri, 14 Dec 2018 00:16:11 +0000 (19:16 -0500)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Fri, 14 Dec 2018 12:10:16 +0000 (12:10 +0000)
The teardown of the pads checks the refcount, but there are timers
inside the jitterbuffer that can push things, so if we're not lucky,
things could be pushed while the pads are being shut down. Putting the
jitterbuffer to NULL first avoids this.

tests/check/elements/rtpjitterbuffer.c

index 5c13a0c..80da5b5 100644 (file)
@@ -168,6 +168,7 @@ cleanup_jitterbuffer (GstElement * jitterbuffer)
 
   gst_pad_set_active (mysrcpad, FALSE);
   gst_pad_set_active (mysinkpad, FALSE);
+  gst_element_set_state (jitterbuffer, GST_STATE_NULL);
   gst_check_teardown_src_pad (jitterbuffer);
   gst_check_teardown_sink_pad (jitterbuffer);
   gst_check_teardown_element (jitterbuffer);