stream: improve EOF handling in seeks
commita0f08fbebbdf211ce2a69f1c3ab891a5a1ca9b8c
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Mon, 18 Jan 2010 12:38:56 +0000 (18 14:38 +0200)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Mon, 18 Jan 2010 12:38:56 +0000 (18 14:38 +0200)
tree581f32ae817df7a390f721c7a74cad389e502d13
parent1f126fc60cdfb7eef4d42c1593aaaddda4935a37
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>.
stream/stream.c
stream/stream.h