[MPlayer-dev-eng] [PATCH] bad seeking in stream.c, buffer flushed to early
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Sep 13 20:52:34 CEST 2004
Hi,
>>stream_seek_long first sets s->buf_pos=s->buf_len=0; (thus clearing the
>>buffer) before attempting to seek, which effectively makes it seek
>>forward instead of backwards on linear streams (e.g. when doing cat test
>>| mplayer -nocache -).
>>Simply commenting this out made it work for me and I couldn't detect any
>>ill effects, but somebody who knows this code should check this.
>
> Don't think this is good idea. The name *_seek_long meen that we must
> seek, thus empty the buffer.
The question is why do we have to empty the buffer that early and not
after we actually did seek successfully? As it is currently, if the seek
fails for some unexpected reason, the stream position will change
anyway, which I consider a bad thing...
I also think that the buffer is emptied somewhere else anyway, as
seeking still works for me after this patch...
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list