mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
Add timestamps on the buffers
Original commit message from CVS: Add timestamps on the buffers
This commit is contained in:
parent
e9b7efe157
commit
8926b8607d
2 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue