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

stream: something

This commit is contained in:
wm4 2018-10-11 05:43:54 +02:00 committed by Anton Kindestam
parent f4ce3b8bb9
commit 9b10869a61

View File

@ -505,13 +505,14 @@ bool stream_seek(stream_t *s, int64_t pos)
s->eof = 0; // eof should be set only on read; seeking always clears it
if (pos == stream_tell(s))
return true;
if (pos < 0) {
MP_ERR(s, "Invalid seek to negative position %lld!\n", (long long)pos);
pos = 0;
}
if (pos == stream_tell(s))
return true;
if (pos < s->pos) {
int64_t x = pos - (s->pos - (int)s->buf_len);
if (x >= 0) {