From: Edward Hervey Date: Mon, 8 Jun 2020 06:11:00 +0000 (+0200) Subject: tests: Avoid hang with decodebin test X-Git-Tag: 1.19.3~511^2~582 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78444fc62225bd1ea6f3ba172b4962b75327fcbe;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/tests/check/elements/decodebin.c b/tests/check/elements/decodebin.c index 86d004e..f27fb7c 100644 --- a/tests/check/elements/decodebin.c +++ b/tests/check/elements/decodebin.c @@ -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)