summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2009-05-05 18:54:31 +0200
committerJan Schmidt <thaytan@noraisin.net>2009-06-20 15:21:38 +0100
commit616038423f2a43091fd9e889435751860b009599 (patch)
tree1d54b9682df662b7d9f0e034f33250ecb72aaa84 /sys
parent42d90ddfa3b25222ed9b37d7e0ba2030715ee8be (diff)
downloadgst-plugins-bad-616038423f2a43091fd9e889435751860b009599.tar.gz
gst-plugins-bad-616038423f2a43091fd9e889435751860b009599.tar.bz2
gst-plugins-bad-616038423f2a43091fd9e889435751860b009599.zip
vdpaumpegdec: fixup timestamping of outgoing buffers
Diffstat (limited to 'sys')
-rw-r--r--sys/vdpau/gstvdpdecoder.c11
-rw-r--r--sys/vdpau/gstvdpdecoder.h2
2 files changed, 8 insertions, 5 deletions
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 {