From d235380cd3ae9490a25937ee44b08615ed97e1cc Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 25 Oct 2017 16:16:03 +0200 Subject: demux: reject cache seeks if parts of the range are unset In theory, start/ts_min could be set to NOPTS, in which case "pts < start" for a valid pts would always evaluate to false. Also remove the redundant "in-cache seek is possible.." message, as there's always another message when cache seeks are done. --- demux/demux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'demux') diff --git a/demux/demux.c b/demux/demux.c index 492f704876..5c7b99358b 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1670,10 +1670,11 @@ static bool try_seek_cache(struct demux_internal *in, double pts, int flags) MP_VERBOSE(in, "in-cache seek range = %f <-> %f (%f)\n", start, end, pts); - if (pts < start || pts > end) + if (start == MP_NOPTS_VALUE || end == MP_NOPTS_VALUE) return false; - MP_VERBOSE(in, "in-cache seek is possible..\n"); + if (pts < start || pts > end) + return false; clear_reader_state(in); -- cgit v1.2.3