tests: Don't set dtlsenc state before linking.
authorJan Schmidt <jan@centricular.com>
Sat, 31 Oct 2020 10:46:16 +0000 (21:46 +1100)
committerJan Schmidt <jan@centricular.com>
Sat, 31 Oct 2020 10:46:16 +0000 (21:46 +1100)
Link the dtlsenc in the testsuite before setting it to paused, as it
starts a pad task that can generate a not-linked error otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1744>

tests/check/elements/dtls.c

index 9068ba5..74149d2 100644 (file)
@@ -140,12 +140,13 @@ GST_START_TEST (test_data_transfer)
   g_object_set (c_enc, "connection-id", "client", "is-client", TRUE, NULL);
   g_signal_connect (c_enc, "on-key-received", G_CALLBACK (_on_key_received),
       NULL);
-  gst_element_set_state (c_enc, GST_STATE_PAUSED);
   gst_bin_add (GST_BIN (s_bin), c_enc);
 
   gst_element_link_pads (s_enc, "src", c_dec, "sink");
   gst_element_link_pads (c_enc, "src", s_dec, "sink");
 
+  gst_element_set_state (c_enc, GST_STATE_PAUSED);
+
   target = gst_element_get_request_pad (c_dec, "src");
   ghost = gst_ghost_pad_new ("src", target);
   gst_element_add_pad (s_bin, ghost);