From 616038423f2a43091fd9e889435751860b009599 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Tue, 5 May 2009 18:54:31 +0200 Subject: vdpaumpegdec: fixup timestamping of outgoing buffers --- sys/vdpau/gstvdpdecoder.c | 11 +++++++---- sys/vdpau/gstvdpdecoder.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/vdpau/gstvdpdecoder.c b/sys/vdpau/gstvdpdecoder.c index 2b0c888e..12ab6cfc 100644 --- a/sys/vdpau/gstvdpdecoder.c +++ b/sys/vdpau/gstvdpdecoder.c @@ -65,13 +65,16 @@ gst_vdp_decoder_push_video_buffer (GstVdpDecoder * dec, GstVdpVideoBuffer * buffer) { if (GST_BUFFER_TIMESTAMP (buffer) == GST_CLOCK_TIME_NONE) { - GST_BUFFER_TIMESTAMP (buffer) = - gst_util_uint64_scale_int (GST_SECOND * dec->frame_nr, + GST_BUFFER_TIMESTAMP (buffer) = dec->time + + gst_util_uint64_scale_int (GST_SECOND, dec->framerate_denominator, dec->framerate_numerator); - dec->frame_nr++; } gst_buffer_set_caps (GST_BUFFER (buffer), GST_PAD_CAPS (dec->src)); + GST_DEBUG_OBJECT (dec, "Pushin buffer with timestamp: %" GST_TIME_FORMAT, + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer))); + dec->time = GST_BUFFER_TIMESTAMP (buffer); + return gst_pad_push (dec->src, GST_BUFFER (buffer)); } @@ -173,7 +176,7 @@ gst_vdp_decoder_init (GstVdpDecoder * dec, GstVdpDecoderClass * klass) dec->framerate_numerator = 0; dec->framerate_denominator = 0; - dec->frame_nr = 0; + dec->time = 0; dec->src = gst_pad_new_from_static_template (&src_template, "src"); gst_element_add_pad (GST_ELEMENT (dec), dec->src); diff --git a/sys/vdpau/gstvdpdecoder.h b/sys/vdpau/gstvdpdecoder.h index ae53657c..f20db20c 100644 --- a/sys/vdpau/gstvdpdecoder.h +++ b/sys/vdpau/gstvdpdecoder.h @@ -52,7 +52,7 @@ struct _GstVdpDecoder { gint framerate_numerator, framerate_denominator; guint32 format; - gint frame_nr; + GstClockTime time; }; struct _GstVdpDecoderClass { -- cgit v1.2.1