summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-07-05 10:32:42 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-07-05 11:10:09 +0200
commit1d0b29414a936bf07431be940c1b38f0dfb2f920 (patch)
treec4af948ac69f2563c0739a05674dd0967adbfe2a
parentb8f556a566483758be82797421cb9593bba1ac43 (diff)
ffmpegenc: fix timestamp resyncing some more
Convert bytes to samples in remaining occurrence. See #623388.
-rw-r--r--ext/ffmpeg/gstffmpegenc.c6
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;
}
}