From: <mn...@ke...> - 2010-07-05 09:14:03
|
Module: gst-ffmpeg Branch: master Commit: 1d0b29414a936bf07431be940c1b38f0dfb2f920 URL: http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=1d0b29414a936bf07431be940c1b38f0dfb2f920 Author: Mark Nauwelaerts <mar...@co...> Date: Mon Jul 5 10:32:42 2010 +0200 ffmpegenc: fix timestamp resyncing some more Convert bytes to samples in remaining occurrence. See #623388. --- ext/ffmpeg/gstffmpegenc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index 4454347..9f9bc1d 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -960,9 +960,11 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf) "taking upstream timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (upstream_time)); timestamp = upstream_time; + /* samples corresponding to bytes */ + ffmpegenc->adapter_consumed = bytes / (osize * ctx->channels); ffmpegenc->adapter_ts = upstream_time - - gst_util_uint64_scale (bytes, GST_SECOND, ctx->sample_rate); - ffmpegenc->adapter_consumed = bytes; + gst_util_uint64_scale (ffmpegenc->adapter_consumed, GST_SECOND, + ctx->sample_rate); ffmpegenc->discont = TRUE; } } |