mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
ffmpegenc: fix timestamp resyncing some more
Convert bytes to samples in remaining occurrence. See #623388.
This commit is contained in:
parent
b8f556a566
commit
1d0b29414a
1 changed files with 4 additions and 2 deletions
|
@ -960,9 +960,11 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
|
||||||
"taking upstream timestamp %" GST_TIME_FORMAT,
|
"taking upstream timestamp %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (upstream_time));
|
GST_TIME_ARGS (upstream_time));
|
||||||
timestamp = upstream_time;
|
timestamp = upstream_time;
|
||||||
|
/* samples corresponding to bytes */
|
||||||
|
ffmpegenc->adapter_consumed = bytes / (osize * ctx->channels);
|
||||||
ffmpegenc->adapter_ts = upstream_time -
|
ffmpegenc->adapter_ts = upstream_time -
|
||||||
gst_util_uint64_scale (bytes, GST_SECOND, ctx->sample_rate);
|
gst_util_uint64_scale (ffmpegenc->adapter_consumed, GST_SECOND,
|
||||||
ffmpegenc->adapter_consumed = bytes;
|
ctx->sample_rate);
|
||||||
ffmpegenc->discont = TRUE;
|
ffmpegenc->discont = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue