[gst-devel] xvideosink.c: history of unused "correction" field?

David Schleef ds at schleef.org
Mon Mar 10 21:06:09 CET 2003

On Tue, Mar 11, 2003 at 12:35:11PM +0800, Martin Janzen wrote:
> In sys/xvideo/xvideosink.c, a "correction" field is calculated as an
> average of the amount of time required to display an image.  But this
> value is then immediately discarded and not used elsewhere:
>   if (xvideosink->clock) {
>     jitter = gst_clock_get_time (xvideosink->clock) - time;
>     xvideosink->correction = (xvideosink->correction + jitter) >> 1;
>     xvideosink->correction = 0;  /* FIXME? */
>   }
> Does anyone remember what this is/was used for?  Maybe for guessing
> when to display incoming frames that lack a timestamp...?

No.  It's an attempt to estimate an appropriate delay to add to
an "average" frame, so that frames that arrive at xvideosink's
sink pad really late (compared to when they were expected) can
still be displayed on time, so that visible jitter is decreased.

Unfortunately, the method doesn't exactly work as written, since
it assumes that the times that frames arrive is sane, which it

I explored various methods in gst-sci (gstreamer science modules),
but each method had some annoying bug.  I have more ideas, but
they all rapidly become complicated.


More information about the gstreamer-devel mailing list