mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
tests/check/elements/queue.c: fix race in underrun test
Original commit message from CVS: * tests/check/elements/queue.c: (queue_overrun), (queue_underrun), (GST_START_TEST): fix race in underrun test
This commit is contained in:
parent
63873698c3
commit
a378db54fb
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2006-12-21 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* tests/check/elements/queue.c: (queue_overrun), (queue_underrun),
|
||||
(GST_START_TEST):
|
||||
fix race in underrun test
|
||||
|
||||
2006-12-21 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* tests/check/elements/.cvsignore:
|
||||
|
|
|
@ -53,7 +53,10 @@ static void
|
|||
queue_underrun (GstElement * queue, gpointer user_data)
|
||||
{
|
||||
GST_DEBUG ("queue underrun");
|
||||
g_mutex_lock (check_mutex);
|
||||
underrun_count++;
|
||||
g_cond_signal (check_cond);
|
||||
g_mutex_unlock (check_mutex);
|
||||
}
|
||||
|
||||
GstElement *
|
||||
|
@ -99,12 +102,13 @@ GST_START_TEST (test_non_leaky_underrun)
|
|||
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
|
||||
"could not set to playing");
|
||||
|
||||
/* do we need to wait here a little */
|
||||
usleep (100);
|
||||
/**/ GST_DEBUG ("running");
|
||||
GST_DEBUG ("running");
|
||||
g_mutex_lock (check_mutex);
|
||||
g_cond_wait (check_cond, check_mutex);
|
||||
g_mutex_unlock (check_mutex);
|
||||
|
||||
fail_unless (overrun_count == 0);
|
||||
fail_unless (underrun_count > 0);
|
||||
fail_unless (underrun_count == 1);
|
||||
|
||||
fail_unless (buffer == NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue