Commit 430a9ad8 authored by Niklas Haas's avatar Niklas Haas
Browse files

utils/frame_queue: relax backwards PTS jump stringency

mpv in particular likes generating small backwards jumps sometimes. In
practice, we can deal with them more or less fine - the only issue is
when we step so far back that we no longer have those frames in the
queue at all. Error in this case. In all other cases, just deal with it.
parent 6e60a030
......@@ -526,11 +526,17 @@ enum pl_queue_status pl_queue_update(struct pl_queue *p,
float delta = params->pts - p->prev_pts;
if (delta < 0.0) {
PL_ERR(p, "Requested PTS %f is lower than the previously rendered "
// This is a backwards PTS jump. This is something we can handle
// semi-gracefully, but only if we haven't culled past the current
// frame yet.
if (p->queue.num && p->queue.elem[0].src.pts > params->pts) {
PL_ERR(p, "Requested PTS %f is lower than the oldest frame "
"PTS %f. This is not supported, PTS must be monotonically "
"increasing! Please use `pl_queue_reset` to reset the frame "
"queue on discontinuous PTS jumps.", params->pts, p->prev_pts);
"queue on discontinuous PTS jumps.",
params->pts, p->queue.elem[0].src.pts);
return QUEUE_ERR;
} else if (delta > 1.0) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment