[Ffmpeg-devel] file length / http

Rich Felker dalias
Mon Dec 18 10:42:58 CET 2006


On Sun, Dec 17, 2006 at 10:15:48PM -0500, Ronald S. Bultje wrote:
> Hi all,
> 
> I've looked at the input provided to my http seeking patch, and am also
> looking at making sure it works correctly with both seekable and
> unseekable servers without too much trouble.
> 
> One thing I noticed is that a lot of demuxers currently use SEEK_END, -1
> followed by SEEK_SET, 0 to find out the length of a file. Worse yet,
> url_fsize() is implemented in exactly that manner.
> This is OK for files. However, for streams, this can cause considerable
> delay while reopening the HTTP/tcp connection. Also, this will not
> always work, e.g. if the server doesn't support seeking. Still, the file
> length may be known (through the http Content-Length property in the
> reply header).

This is probably the source of the bug report I posted on
mplayer-advusers recently, and it's extremely evil, especially if
you're doing cache/buffering since all the buffered data is thrown
away on seeking. I would welcome any fix to this nonsense behavior,
regardless of whether it breaks knowledge of the file length or not.
:)

Rich





More information about the ffmpeg-devel mailing list