Commit 8926b860 authored by Wim Taymans's avatar Wim Taymans
Browse files

Add timestamps on the buffers

Original commit message from CVS:
Add timestamps on the buffers
parent e9b7efe1
......@@ -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 */
......
......@@ -65,6 +65,7 @@ struct _VorbisDec {
gboolean eos;
int16_t convsize;
guint64 total_out;
};
struct _VorbisDecClass {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment