0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

stream: add an assert() to an obscure seek case

This affects small seeks backwards while within the buffer. Demuxers
usually avoid this, so it's probably not triggered very often. (Although
demux_mkv.c potentially triggers it often, and it uses stream_peek() to
explicitly guarantee that it can use this code to seek back.) The
condition is complex enough to warrant an assertion.
This commit is contained in:
wm4 2017-08-17 17:29:17 +02:00
parent 79a39aeebd
commit b9430309ec

View File

@ -563,6 +563,7 @@ bool stream_seek(stream_t *s, int64_t pos)
int64_t x = pos - (s->pos - (int)s->buf_len);
if (x >= 0) {
s->buf_pos = x;
assert(s->buf_pos <= s->buf_len);
return true;
}
}