2008-04-03 Wim Taymans <wim.taymans@collabora.co.uk>
+ * gst-libs/gst/audio/gstbaseaudiosink.c:
+ (gst_base_audio_sink_skew_slaving), (gst_base_audio_sink_render):
+ Guard against over and underflows because of clock slaving.
+ When we are using our own clock, still compensate for any calibrations
+ that we might have done to our clock.
+
+2008-04-03 Wim Taymans <wim.taymans@collabora.co.uk>
+
* ext/theora/theoradec.c: (theora_handle_type_packet),
(theora_dec_chain):
Don't try to do anything fancy with the return code from pushing an
etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink));
itime = gst_clock_get_internal_time (sink->provided_clock);
- etime -= cexternal;
- itime -= cinternal;
+ /* make sure we never go below 0 */
+ etime = etime > cexternal ? etime - cexternal : 0;
+ itime = itime > cinternal ? itime - cinternal : 0;
skew = GST_CLOCK_DIFF (etime, itime);
if (sink->priv->avg_skew == -1) {
GST_WARNING_OBJECT (sink,
"correct clock skew %" G_GINT64_FORMAT " > %" G_GINT64_FORMAT,
sink->priv->avg_skew, segtime2);
- cinternal += segtime;
+ cexternal = cexternal > segtime ? cexternal - segtime : 0;
sink->priv->avg_skew -= segtime;
segsamples =
/* handle clock slaving */
gst_base_audio_sink_handle_slaving (sink, render_start, render_stop,
&render_start, &render_stop);
+ } else {
+ /* no slaving needed but we need to adapt to the clock calibration
+ * parameters */
+ gst_base_audio_sink_none_slaving (sink, render_start, render_stop,
+ &render_start, &render_stop);
}
/* and bring the time to the rate corrected offset in the buffer */