+2005-11-17 Michael Smith <msmith@fluendo.com>
+
+ * gst/gstclock.c: (gst_clock_init), (gst_clock_adjust_unlocked),
+ (gst_clock_set_rate_offset), (gst_clock_get_rate_offset):
+ * gst/gstclock.h:
+ Anonymous structs are a gcc (and some other compilers) extension, so
+ don't use them. Since this is only for ABI-compatibility, and our
+ API/ABI freeze is over in a few days, this whole thing will only
+ last a few days, so don't bother trying to think up a meaningful
+ name for the struct.
+
2005-11-17 Andy Wingo <wingo@pobox.com>
* gst/gstclock.h (GstClock): Add rate and offset properties,
clock->flags = 0;
clock->stats = FALSE;
- clock->rate = 1.0;
- clock->offset = 0;
+ clock->A.rate = 1.0;
+ clock->A.offset = 0;
}
static void
/* internal is uint64, rate is double, offset is int64, ret is uint64 */
- ret = internal * clock->rate;
+ ret = internal * clock->A.rate;
- if (clock->offset < 0) {
- if ((clock->offset == G_MININT64 && ret <= G_MAXINT64)
- || (clock->offset + ((gint64) ret) < 0))
+ if (clock->A.offset < 0) {
+ if ((clock->A.offset == G_MININT64 && ret <= G_MAXINT64)
+ || (clock->A.offset + ((gint64) ret) < 0))
/* underflow */
ret = 0;
else
- ret -= (guint64) (-clock->offset);
+ ret -= (guint64) (-clock->A.offset);
} else {
- if (clock->offset > 0 && ret >= G_MAXINT64
- && G_MAXUINT64 - ret - 1 <= clock->offset)
+ if (clock->A.offset > 0 && ret >= G_MAXINT64
+ && G_MAXUINT64 - ret - 1 <= clock->A.offset)
/* overflow, but avoiding CLOCK_TIME_NONE which is MAXUINT64 */
ret = G_MAXUINT64 - 1;
else
- ret += (guint64) clock->offset;
+ ret += (guint64) clock->A.offset;
}
/* make sure the time is increasing */
g_return_if_fail (rate > 0.0);
GST_LOCK (clock);
- clock->rate = rate;
- clock->offset = offset;
+ clock->A.rate = rate;
+ clock->A.offset = offset;
GST_UNLOCK (clock);
}
g_return_if_fail (offset != NULL);
GST_LOCK (clock);
- *rate = clock->rate;
- *offset = clock->offset;
+ *rate = clock->A.rate;
+ *offset = clock->A.offset;
GST_UNLOCK (clock);
}