jitterbuffer: also estimate eos if very near eos
This commit is contained in:
parent
3c9a4239bf
commit
1f7f434df6
@ -1873,17 +1873,25 @@ push_buffer:
|
|||||||
|
|
||||||
elapsed = compute_elapsed (jitterbuffer, outbuf);
|
elapsed = compute_elapsed (jitterbuffer, outbuf);
|
||||||
|
|
||||||
if (elapsed > priv->last_elapsed) {
|
if (elapsed > priv->last_elapsed || !priv->last_elapsed) {
|
||||||
guint64 left;
|
guint64 left;
|
||||||
|
|
||||||
priv->last_elapsed = elapsed;
|
priv->last_elapsed = elapsed;
|
||||||
|
|
||||||
left = priv->npt_stop - priv->npt_start;
|
left = priv->npt_stop - priv->npt_start;
|
||||||
|
GST_LOG_OBJECT (jitterbuffer, "left %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (left));
|
||||||
|
|
||||||
if (elapsed > 0)
|
if (elapsed > 0)
|
||||||
estimated = gst_util_uint64_scale (out_time, left, elapsed);
|
estimated = gst_util_uint64_scale (out_time, left, elapsed);
|
||||||
else
|
else {
|
||||||
estimated = -1;
|
/* 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_LOG_OBJECT (jitterbuffer, "elapsed %" GST_TIME_FORMAT ", estimated %"
|
||||||
GST_TIME_FORMAT, GST_TIME_ARGS (elapsed), GST_TIME_ARGS (estimated));
|
GST_TIME_FORMAT, GST_TIME_ARGS (elapsed), GST_TIME_ARGS (estimated));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user