[MPlayer-dev-eng] [PATCH] stream seek eof handling
Uoti Urpala
uoti.urpala at pp1.inet.fi
Fri Oct 17 20:07:23 CEST 2008
On Fri, 2008-10-17 at 11:52 -0400, Laurent wrote:
> Here is an attempt to clean this issue.
>
> * stream_t->eof flag is cleared when seek succeeds.
>
> * EOF and past EOF positions are valid for seek. Though, following
> read will fail.
> At least, this allows lavc to detect end of streams by checking if the
> current stream position is equal or past the EOF position (what lavc
> does).
> +if ((pos+newpos) >= s->end_pos) {
This assumes that all seekable streams have a length that is known in
advance. IMO such assumptions should not be required. Wouldn't it be
enough to make the seek function work as follows?
1) reset ->eof at start of seek attempt
2) return success even if the subsequent stream_fill_buffer() fails
This could still return failure if the underlying stream type seek call
fails when trying to seek to EOF or later, but at least the common types
I looked at don't seem to do that at EOF.
More information about the MPlayer-dev-eng
mailing list