mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 18:22:23 +00:00
webrtcbin test: Fix race in new test
Pull a buffer from a sink to make sure that the caps are already set before trying to update them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2348>
This commit is contained in:
parent
85c17f6c23
commit
71052f0321
1 changed files with 8 additions and 0 deletions
|
@ -4074,6 +4074,7 @@ GST_START_TEST (test_codec_preferences_negotiation_srcpad)
|
||||||
GstHarness *sink_harness = NULL;
|
GstHarness *sink_harness = NULL;
|
||||||
guint i;
|
guint i;
|
||||||
GstElement *rtpbin2;
|
GstElement *rtpbin2;
|
||||||
|
GstBuffer *buf;
|
||||||
|
|
||||||
t->on_negotiation_needed = NULL;
|
t->on_negotiation_needed = NULL;
|
||||||
t->on_ice_candidate = NULL;
|
t->on_ice_candidate = NULL;
|
||||||
|
@ -4108,6 +4109,13 @@ GST_START_TEST (test_codec_preferences_negotiation_srcpad)
|
||||||
g_mutex_unlock (&t->lock);
|
g_mutex_unlock (&t->lock);
|
||||||
fail_unless (sink_harness->element == t->webrtc2);
|
fail_unless (sink_harness->element == t->webrtc2);
|
||||||
|
|
||||||
|
/* Get one buffer out, this makes sure the capsfilter is primed and
|
||||||
|
* avoids races.
|
||||||
|
*/
|
||||||
|
buf = gst_harness_pull (sink_harness);
|
||||||
|
fail_unless (buf != NULL);
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
gst_harness_set_sink_caps_str (sink_harness, OPUS_RTP_CAPS (100));
|
gst_harness_set_sink_caps_str (sink_harness, OPUS_RTP_CAPS (100));
|
||||||
|
|
||||||
test_webrtc_reset_negotiation (t);
|
test_webrtc_reset_negotiation (t);
|
||||||
|
|
Loading…
Reference in a new issue