ffmpegenc: fix timestamp resyncing some more

Convert bytes to samples in remaining occurrence.

See #623388.
This commit is contained in:
Mark Nauwelaerts 2010-07-05 10:32:42 +02:00
parent b8f556a566
commit 1d0b29414a

View file

@ -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;
}
}