From: Wim Taymans Date: Sat, 2 Feb 2002 14:03:05 +0000 (+0000) Subject: Add timestamps on the buffers X-Git-Tag: BRANCH-EVENTS2-ROOT~115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8926b8607ddd2275981866734a184c05f4235c5b;p=platform%2Fupstream%2Fgst-plugins-base.git Add timestamps on the buffers Original commit message from CVS: Add timestamps on the buffers --- diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 17ef93f..afcf479 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -102,6 +102,7 @@ gst_vorbisdec_init (VorbisDec * vorbisdec) ogg_sync_init (&vorbisdec->oy); /* Now we can read pages */ vorbisdec->convsize = 4096; + vorbisdec->total_out = 0; } static GstBuffer * @@ -363,9 +364,13 @@ gst_vorbisdec_loop (GstElement * element) int clipflag = 0; int bout = (samples < vorbisdec->convsize ? samples : vorbisdec->convsize); + outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = g_malloc (2 * vi.channels * bout); GST_BUFFER_SIZE (outbuf) = 2 * vi.channels * bout; + GST_BUFFER_TIMESTAMP (outbuf) = vorbisdec->total_out * 1000000LL / vi.rate; + + vorbisdec->total_out += bout; /* convert doubles to 16 bit signed ints (host order) and interleave */ diff --git a/ext/vorbis/vorbisdec.h b/ext/vorbis/vorbisdec.h index bcbac6e..a391a54 100644 --- a/ext/vorbis/vorbisdec.h +++ b/ext/vorbis/vorbisdec.h @@ -65,6 +65,7 @@ struct _VorbisDec { gboolean eos; int16_t convsize; + guint64 total_out; }; struct _VorbisDecClass {