-static void
-update_clock(GstVaapiDecoder *decoder, GstBuffer *buffer)
-{
- GstVaapiDecoderPrivate * const priv = decoder->priv;
- GstClockTime timestamp, duration;
-
- timestamp = GST_BUFFER_TIMESTAMP(buffer);
- duration = GST_BUFFER_DURATION(buffer);
-
- if (GST_CLOCK_TIME_IS_VALID(duration)) {
- if (GST_CLOCK_TIME_IS_VALID(timestamp))
- priv->surface_timestamp = timestamp;
- priv->surface_duration = duration;
- }
- else {
- /* Assumes those are user-generated buffers with no timestamp
- or duration information. Try to rely on "framerate". */
- if (!GST_CLOCK_TIME_IS_VALID(priv->surface_timestamp))
- priv->surface_timestamp = 0;
- priv->surface_duration =
- gst_util_uint64_scale_int(GST_SECOND, priv->fps_d, priv->fps_n);
- }
-}
-