summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-25 16:16:03 +0200
committerwm4 <wm4@nowhere>2017-10-25 16:39:33 +0200
commitd235380cd3ae9490a25937ee44b08615ed97e1cc (patch)
treeda67472e9f0e0b6471909ca22d83193e4c94090d
parent03a0e8336a89e686f4274121bc86987398e8c71c (diff)
downloadmpv-d235380cd3ae9490a25937ee44b08615ed97e1cc.tar.bz2
mpv-d235380cd3ae9490a25937ee44b08615ed97e1cc.tar.xz
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.
-rw-r--r--demux/demux.c5
1 files changed, 3 insertions, 2 deletions
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);