summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-18 14:38:56 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-18 14:38:56 +0200
commita0f08fbebbdf211ce2a69f1c3ab891a5a1ca9b8c (patch)
tree581f32ae817df7a390f721c7a74cad389e502d13 /stream/stream.h
parent1f126fc60cdfb7eef4d42c1593aaaddda4935a37 (diff)
downloadmpv-a0f08fbebbdf211ce2a69f1c3ab891a5a1ca9b8c.tar.bz2
mpv-a0f08fbebbdf211ce2a69f1c3ab891a5a1ca9b8c.tar.xz
stream: improve EOF handling in seeks
Reset stream 'eof' flag when a seek succeeds, and allow seeking to a position at or past EOF (in the sense that the seek succeeds and stream_tell() then returns that position). This fixes at least some demuxer problems where an attempt to read the index from the end of an incomplete file would set the 'eof' flag and cause subsequent reads to fail, even if failure to read the index would otherwise be nonfatal and demuxing could continue after seeking back. Partially based on a patch from Laurent <laurent.aml@gmail.com>.
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/stream/stream.h b/stream/stream.h
index 68d4937ad2..135be37b69 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -269,6 +269,7 @@ inline static int stream_seek(stream_t *s,off_t pos){
off_t x=pos-(s->pos-s->buf_len);
if(x>=0){
s->buf_pos=x;
+ s->eof = 0;
// putchar('*');fflush(stdout);
return 1;
}