diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-09-18 11:43:46 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-09-18 14:46:38 +0200 |
commit | f4482e4ae3d4a55c31ee572e19f184e903180b95 (patch) | |
tree | 83a4a0d687d819b3b5287c3ceafa692807c73e59 /ext/speex/gstspeexenc.c | |
parent | 0868ddf30fa8ff9b85b34061d604b3eccd325712 (diff) |
speexenc: fix buffer time and duration for multiple frames per packet
Diffstat (limited to 'ext/speex/gstspeexenc.c')
-rw-r--r-- | ext/speex/gstspeexenc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 17e17034..60fc1d9e 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -928,10 +928,11 @@ gst_speex_enc_encode (GstSpeexEnc * enc, gboolean flush) speex_bits_reset (&enc->bits); GST_BUFFER_TIMESTAMP (outbuf) = enc->start_ts + - gst_util_uint64_scale_int ((enc->frameno_out - 1) * frame_size - - enc->lookahead, GST_SECOND, enc->rate); - GST_BUFFER_DURATION (outbuf) = gst_util_uint64_scale_int (frame_size, - GST_SECOND, enc->rate); + gst_util_uint64_scale_int ((enc->frameno_out - + enc->nframes) * frame_size - enc->lookahead, GST_SECOND, enc->rate); + GST_BUFFER_DURATION (outbuf) = + gst_util_uint64_scale_int (frame_size * enc->nframes, GST_SECOND, + enc->rate); /* set gp time and granulepos; see gst-plugins-base/ext/ogg/README */ GST_BUFFER_OFFSET_END (outbuf) = enc->granulepos_offset + ((enc->frameno_out) * frame_size - enc->lookahead); |