mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
tests/webrtcbin: Add a lock around the stats test
Prevent any race if both webrtcbin end up generating their statistics simultaneously, however unlikely. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7365>
This commit is contained in:
parent
460f5dcb33
commit
d266995323
1 changed files with 4 additions and 0 deletions
|
@ -1829,9 +1829,13 @@ _on_stats (GstPromise * promise, gpointer user_data)
|
|||
int i;
|
||||
|
||||
validate_stats (reply);
|
||||
|
||||
g_mutex_lock (&t->lock);
|
||||
i = GPOINTER_TO_INT (t->user_data);
|
||||
i++;
|
||||
t->user_data = GINT_TO_POINTER (i);
|
||||
g_mutex_unlock (&t->lock);
|
||||
|
||||
if (i >= 2)
|
||||
test_webrtc_signal_state (t, STATE_CUSTOM);
|
||||
|
||||
|
|
Loading…
Reference in a new issue