demux: fix minor seek_preroll consistency issue

When packet appending sets the start of the range, it adjusts the range
by seek_preroll. Do this when packets are pruned from the start of the
range too.

(Yeah, seek_preroll handling is probably broken in some other cases. It
was halfhearted to begin with.)
This commit is contained in:
wm4 2019-06-10 22:30:28 +02:00
parent 0f6cda4ab1
commit 73a48ff47b
1 changed files with 2 additions and 0 deletions

View File

@ -2185,6 +2185,8 @@ static void prune_old_packets(struct demux_internal *in)
queue->seek_start = kf_min;
if (queue->seek_start != MP_NOPTS_VALUE) {
queue->seek_start += ds->sh->seek_preroll;
// Don't need to update if the new start is still before the
// range's start (or if the range was undefined anyway).
if (range->seek_start == MP_NOPTS_VALUE ||