summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2013-09-23 11:47:14 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-09-23 11:47:14 +0200
commitcba26c9ed901e9cce4812519db5f04ac0d198f5d (patch)
tree7fcbf9dc3eecf82148754247a7a806de5bab92d9 /libs
parent3e4b4eb59bb691c9e1c00a7a5268e68d4444bc7d (diff)
tests: handle unscheduled entries correctly
Make the testclock return GST_CLOCK_UNSCHEDULED when an unscheduled entry is used for gst_clock_wait() or gst_clock_wait_async(). Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708605
Diffstat (limited to 'libs')
-rw-r--r--libs/gst/check/gsttestclock.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/gst/check/gsttestclock.c b/libs/gst/check/gsttestclock.c
index 120337b8b..f9737a6aa 100644
--- a/libs/gst/check/gsttestclock.c
+++ b/libs/gst/check/gsttestclock.c
@@ -423,6 +423,9 @@ gst_test_clock_wait (GstClock * clock,
"requesting synchronous clock notification at %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_CLOCK_ENTRY_TIME (entry)));
+ if (GST_CLOCK_ENTRY_STATUS (entry) == GST_CLOCK_UNSCHEDULED)
+ goto was_unscheduled;
+
if (gst_test_clock_lookup_entry_context (test_clock, entry) == NULL)
gst_test_clock_add_entry (test_clock, entry, jitter);
@@ -434,6 +437,15 @@ gst_test_clock_wait (GstClock * clock,
GST_OBJECT_UNLOCK (test_clock);
return GST_CLOCK_ENTRY_STATUS (entry);
+
+ /* ERRORS */
+was_unscheduled:
+ {
+ GST_CAT_DEBUG_OBJECT (GST_CAT_TEST_CLOCK, test_clock,
+ "entry was unscheduled");
+ GST_OBJECT_UNLOCK (test_clock);
+ return GST_CLOCK_UNSCHEDULED;
+ }
}
static GstClockReturn
@@ -443,6 +455,9 @@ gst_test_clock_wait_async (GstClock * clock, GstClockEntry * entry)
GST_OBJECT_LOCK (test_clock);
+ if (GST_CLOCK_ENTRY_STATUS (entry) == GST_CLOCK_UNSCHEDULED)
+ goto was_unscheduled;
+
GST_CAT_DEBUG_OBJECT (GST_CAT_TEST_CLOCK, test_clock,
"requesting asynchronous clock notification at %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_CLOCK_ENTRY_TIME (entry)));
@@ -452,6 +467,15 @@ gst_test_clock_wait_async (GstClock * clock, GstClockEntry * entry)
GST_OBJECT_UNLOCK (test_clock);
return GST_CLOCK_OK;
+
+ /* ERRORS */
+was_unscheduled:
+ {
+ GST_CAT_DEBUG_OBJECT (GST_CAT_TEST_CLOCK, test_clock,
+ "entry was unscheduled");
+ GST_OBJECT_UNLOCK (test_clock);
+ return GST_CLOCK_UNSCHEDULED;
+ }
}
static void