[MPlayer-dev-eng] Re: [PATCH] Fix some seek failure

Alban Bedel albeu at free.fr
Wed Mar 15 16:01:05 CET 2006


On Tue, 14 Mar 2006 10:22:17 +0200
"Ivan Kalvachev" <ikalvachev at gmail.com> wrote:

> 2006/3/13, Alban Bedel <albeu at free.fr>:
> >
> > Hi,
> >
> > their is a little bug in stream_seek() which can lead to some
> > strange seeking failure, in particular with ftp.
> > Seeks are always aligned on the buffer size, then a single
> > stream_fill_buffer is made and failure is returned if the wanted
> > position is not in the buffer. So that obviously can fail if the
> > call to stream_fill_buffer() doesn't fill the whole buffer (it
> > doesn't have to).
> [..]
> 
> Are you sure it doesn't have to?
> 
> I think stream_fill_buffer is always supposed to return full buffer,
> unless EOF is reached (then it returns only the available data). It is
> used this way on few other places (e.g. cache.c) and they would need
> fixing. It would be better to fix it in stream_fill_buffer or t

I double checked and that should be ok. stream_fill_buffer() is an
"internal" function. It is only called from stream_seek_long() and
cache_stream_fill_buffer(). The cache use stream_read() to fill his
buffer, so no pb there.

	Albeu




More information about the MPlayer-dev-eng mailing list