mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
tests: Avoid hang with decodebin test
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>
This commit is contained in:
parent
9c3cff287e
commit
78444fc622
1 changed files with 1 additions and 2 deletions
|
@ -127,12 +127,11 @@ pad_added_plug_fakesink_cb (GstElement * decodebin, GstPad * srcpad,
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue