+2005-01-17 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/alsa/gstalsaclock.c: (gst_alsa_clock_wait):
+ Sanity check, don't wait endlessly since the clock might not
+ actually run at this point (which is a deadlock). Fixes #164069.
+
2005-01-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gstplaybasebin.c: (probe_triggered):
static GstClockEntryStatus
gst_alsa_clock_wait (GstClock * clock, GstClockEntry * entry)
{
- GstClockTime target, entry_time;
+ GstClockTime target, entry_time, glib_start, glib_cur;
GstClockTimeDiff diff;
GstAlsaClock *this = GST_ALSA_CLOCK (clock);
+ GTimeVal t;
entry_time = gst_alsa_clock_get_internal_time (clock);
diff = GST_CLOCK_ENTRY_TIME (entry) - gst_clock_get_time (clock);
GST_TIME_ARGS (target), GST_TIME_ARGS (GST_CLOCK_ENTRY_TIME (entry)),
GST_TIME_ARGS (entry_time));
+ g_get_current_time (&t);
+ glib_cur = glib_start = GST_TIMEVAL_TO_TIME (t);
while (gst_alsa_clock_get_internal_time (clock) < target &&
- this->last_unlock < entry_time) {
+ this->last_unlock < entry_time && glib_start + diff * 1.5 > glib_cur) {
g_usleep (gst_alsa_clock_get_resolution (clock) * G_USEC_PER_SEC /
GST_SECOND);
+ g_get_current_time (&t);
+ glib_cur = GST_TIMEVAL_TO_TIME (t);
}
return entry->status;