mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 13:41:49 +00: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:
parent
79a39aeebd
commit
b9430309ec
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user