From 8926b8607ddd2275981866734a184c05f4235c5b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 2 Feb 2002 14:03:05 +0000 Subject: [PATCH] Add timestamps on the buffers Original commit message from CVS: Add timestamps on the buffers --- ext/vorbis/vorbisdec.c | 5 +++++ ext/vorbis/vorbisdec.h | 1 + 2 files changed, 6 insertions(+) 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 { -- 2.7.4