summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2021-04-12 15:35:41 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2021-04-12 18:37:27 -0400
commit474c4bf08fa41201cd1219dd0c3c837dd276a590 (patch)
tree77b9dfab63fd9f4aadbbfcab4873fd10e31bcbb7 /tests
parent12ab469ad3665d8a6db6fa3c155a1f937d11755b (diff)
downloadgstreamer-plugins-bad-474c4bf08fa41201cd1219dd0c3c837dd276a590.tar.gz
webrtcbin test: Wait for set-local-desc & set-remote-desc to continue
To avoid racing betwen the SDPs being set and the next step of the test, let's wait for setting the SDP both locally and remotely to succeed. of the test Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/webrtcbin.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/check/elements/webrtcbin.c b/tests/check/elements/webrtcbin.c
index d3c8dc7bb..9cdeb434c 100644
--- a/tests/check/elements/webrtcbin.c
+++ b/tests/check/elements/webrtcbin.c
@@ -159,12 +159,13 @@ _on_answer_set (GstPromise * promise, gpointer user_data)
GstElement *answerer = TEST_GET_ANSWERER (t);
g_mutex_lock (&t->lock);
- if (++t->answer_set_count >= 2 && t->on_answer_set) {
- t->on_answer_set (t, answerer, promise, t->answer_set_data);
+ if (++t->answer_set_count >= 2) {
+ if (t->on_answer_set)
+ t->on_answer_set (t, answerer, promise, t->answer_set_data);
+ if (t->state == STATE_ANSWER_CREATED)
+ t->state = STATE_ANSWER_SET;
+ g_cond_broadcast (&t->cond);
}
- if (t->state == STATE_ANSWER_CREATED)
- t->state = STATE_ANSWER_SET;
- g_cond_broadcast (&t->cond);
gst_promise_unref (promise);
g_mutex_unlock (&t->lock);
}
@@ -232,12 +233,13 @@ _on_offer_set (GstPromise * promise, gpointer user_data)
GstElement *offeror = TEST_GET_OFFEROR (t);
g_mutex_lock (&t->lock);
- if (++t->offer_set_count >= 2 && t->on_offer_set) {
- t->on_offer_set (t, offeror, promise, t->offer_set_data);
+ if (++t->offer_set_count >= 2) {
+ if (t->on_offer_set)
+ t->on_offer_set (t, offeror, promise, t->offer_set_data);
+ if (t->state == STATE_OFFER_CREATED)
+ t->state = STATE_OFFER_SET;
+ g_cond_broadcast (&t->cond);
}
- if (t->state == STATE_OFFER_CREATED)
- t->state = STATE_OFFER_SET;
- g_cond_broadcast (&t->cond);
gst_promise_unref (promise);
g_mutex_unlock (&t->lock);
}