mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
jitterbuffer: also estimate eos if very near eos
This commit is contained in:
parent
3c9a4239bf
commit
1f7f434df6
1 changed files with 11 additions and 3 deletions
|
@ -1873,17 +1873,25 @@ push_buffer:
|
|||
|
||||
elapsed = compute_elapsed (jitterbuffer, outbuf);
|
||||
|
||||
if (elapsed > priv->last_elapsed) {
|
||||
if (elapsed > priv->last_elapsed || !priv->last_elapsed) {
|
||||
guint64 left;
|
||||
|
||||
priv->last_elapsed = elapsed;
|
||||
|
||||
left = priv->npt_stop - priv->npt_start;
|
||||
GST_LOG_OBJECT (jitterbuffer, "left %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (left));
|
||||
|
||||
if (elapsed > 0)
|
||||
estimated = gst_util_uint64_scale (out_time, left, elapsed);
|
||||
else
|
||||
estimated = -1;
|
||||
else {
|
||||
/* if there is almost nothing left,
|
||||
* we may never advance enough to end up in the above case */
|
||||
if (left < GST_SECOND)
|
||||
estimated = GST_SECOND;
|
||||
else
|
||||
estimated = -1;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (jitterbuffer, "elapsed %" GST_TIME_FORMAT ", estimated %"
|
||||
GST_TIME_FORMAT, GST_TIME_ARGS (elapsed), GST_TIME_ARGS (estimated));
|
||||
|
|
Loading…
Reference in a new issue