When adding elements dynamically to a pipeline one should never guess what the
curren/target state is, and instead use `gst_element_sync_state_with_parent()`.
Fixes racy hang when running within valgrind
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/692>
fail_unless (sink != NULL, "Failed to create fakesink element");
gst_bin_add (GST_BIN (pipeline), sink);
+ gst_element_sync_state_with_parent (sink);
sinkpad = gst_element_get_static_pad (sink, "sink");
fail_unless_equals_int (gst_pad_link (srcpad, sinkpad), GST_PAD_LINK_OK);
gst_object_unref (sinkpad);
-
- gst_element_set_state (sink, GST_STATE_PLAYING);
}
GST_START_TEST (test_reuse_without_decoders)