mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 19:18:31 +00:00
tests-clock: Fix race in test_late_crank
There was a case where we started waiting on the clock before setting the clock time, leading to the wait succeeding instead of being late: gsttestclock.c:1073:F:testclock:test_late_crank:0: '1 * GST_SECOND' (1000000000) is not equal to 'context.jitter' (-4000000000) Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/426 Co-authored by: Mathieu Duponchelle <mathieu@centricular.com>
This commit is contained in:
parent
0cb3940c94
commit
767e0e46e9
1 changed files with 3 additions and 3 deletions
|
@ -1058,12 +1058,12 @@ GST_START_TEST (test_late_crank)
|
||||||
clock_id = gst_clock_new_single_shot_id (clock, 5 * GST_SECOND);
|
clock_id = gst_clock_new_single_shot_id (clock, 5 * GST_SECOND);
|
||||||
context.clock_id = gst_clock_id_ref (clock_id);
|
context.clock_id = gst_clock_id_ref (clock_id);
|
||||||
context.jitter = 0;
|
context.jitter = 0;
|
||||||
worker_thread =
|
|
||||||
g_thread_new ("worker_thread_a",
|
|
||||||
test_wait_pending_single_shot_id_sync_worker, &context);
|
|
||||||
|
|
||||||
/* crank the clock while the pending clock id is in the past */
|
/* crank the clock while the pending clock id is in the past */
|
||||||
gst_test_clock_set_time (test_clock, 6 * GST_SECOND);
|
gst_test_clock_set_time (test_clock, 6 * GST_SECOND);
|
||||||
|
worker_thread =
|
||||||
|
g_thread_new ("worker_thread_a",
|
||||||
|
test_wait_pending_single_shot_id_sync_worker, &context);
|
||||||
gst_test_clock_crank (test_clock);
|
gst_test_clock_crank (test_clock);
|
||||||
|
|
||||||
/* the clock should have advanced and the wait released */
|
/* the clock should have advanced and the wait released */
|
||||||
|
|
Loading…
Reference in a new issue