clock: remove pending async wakeup sooner

Remove a pending async wakeup before we check if the next entry is UNSCHEDULED
because we might leave the control socket busy.
This commit is contained in:
Wim Taymans 2009-03-26 21:40:20 +01:00 committed by Wim Taymans
parent 7be99f052b
commit e15cf9bc12

View file

@ -387,6 +387,14 @@ gst_system_clock_async_thread (GstClock * clock)
goto exit;
}
/* see if we have a pending wakeup because the order of the list
* changed. */
if (sysclock->priv->async_wakeup) {
GST_CAT_DEBUG (GST_CAT_CLOCK, "clear async wakeup");
gst_system_clock_remove_wakeup (sysclock);
sysclock->priv->async_wakeup = FALSE;
}
/* pick the next entry */
entry = clock->entries->data;
/* if it was unscheduled, just move on to the next entry */
@ -397,14 +405,6 @@ gst_system_clock_async_thread (GstClock * clock)
requested = entry->time;
/* see if we have a pending wakeup because the order of the list
* changed. */
if (sysclock->priv->async_wakeup) {
GST_CAT_DEBUG (GST_CAT_CLOCK, "clear async wakeup", entry);
gst_system_clock_remove_wakeup (sysclock);
sysclock->priv->async_wakeup = FALSE;
}
/* now wait for the entry, we already hold the lock */
res =
gst_system_clock_id_wait_jitter_unlocked (clock, (GstClockID) entry,