mirror of
https://github.com/mpv-player/mpv
synced 2025-04-18 13:16:43 +00:00
Fix a potential seek failure, fill_buffer doesn't have to
fill the whole buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17879 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
01bb22bcc3
commit
c748950c9f
@ -324,11 +324,13 @@ if(newpos==0 || newpos!=s->pos){
|
||||
// putchar('%');fflush(stdout);
|
||||
}
|
||||
|
||||
stream_fill_buffer(s);
|
||||
if(pos>=0 && pos<=s->buf_len){
|
||||
while(stream_fill_buffer(s) > 0 && pos >= 0) {
|
||||
if(pos<=s->buf_len){
|
||||
s->buf_pos=pos; // byte position in sector
|
||||
return 1;
|
||||
}
|
||||
pos -= s->buf_len;
|
||||
}
|
||||
|
||||
// if(pos==s->buf_len) printf("XXX Seek to last byte of file -> EOF\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user