tests: gstelement: Fix test_add_pad_while_paused flakiness
authorPhilippe Normand <philn@igalia.com>
Wed, 28 Dec 2022 17:42:31 +0000 (17:42 +0000)
committerPhilippe Normand <philn@igalia.com>
Wed, 28 Dec 2022 17:42:31 +0000 (17:42 +0000)
`gst_element_remove_pad()` doesn't automatically deactivate the pad, it has to
be done explicitly beforehand, otherwise the pad task might be left dangling,
exposed to undefined behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3653>

subprojects/gstreamer/tests/check/gst/gstelement.c

index a1bf2aa..a80aa45 100644 (file)
@@ -113,6 +113,7 @@ GST_START_TEST (test_add_pad_while_paused)
   gst_element_set_state (e, GST_STATE_PAUSED);
   {
     GstPad *old_pad = gst_element_get_static_pad (e, "src");
+    gst_pad_set_active (old_pad, FALSE);
     gst_element_remove_pad (e, old_pad);
     gst_object_unref (old_pad);
   }