From e6911f82a579f202765fc382d219447c686d8e54 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 7 Jul 2019 00:32:28 +0200 Subject: demux: don't clobber internal demuxer EOF state in cache seeks The last_eof field is the last known EOF state from the underlying demuxer. Normally, seeks reset it, because obviously if seek back into the middle of the file, you don't want last_eof to have a "wrong" value for a short time window (until a packet is read, which would reset the field to its correct value). This shouldn't happen during cache seeks, because you don't touch the underlying demuxer state. At first, I made this change because some other work in progress required it. It turned out that it was unnecessary, but keep the change anyway, since it's still correct and makes the logic cleaner. --- demux/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demux/demux.c b/demux/demux.c index 9b8e62dc26..b7f650bff7 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -2311,6 +2311,7 @@ static void execute_seek(struct demux_internal *in) { int flags = in->seek_flags; double pts = in->seek_pts; + in->last_eof = false; in->seeking = false; in->seeking_in_progress = pts; in->demux_ts = MP_NOPTS_VALUE; @@ -3626,7 +3627,6 @@ static bool queue_seek(struct demux_internal *in, double seek_pts, int flags, } in->eof = false; - in->last_eof = false; in->idle = true; in->reading = false; in->back_demuxing = set_backwards; -- cgit v1.2.3