[FFmpeg-devel] [PATCH] Fix seeking HTTP when server uses chunked encoding

Tomas Härdin tomas.hardin
Tue May 18 10:34:33 CEST 2010

On Tue, 2010-05-11 at 17:18 +0200, Tomas H?rdin wrote:
> I've attached two patches. The first patch resets chunksize before
> parsing the headers, which fixes the rare case of a resource switching
> chunked encoding off between seeks (could happen once the size of a
> resource becomes known to the server). It also disallows read-write mode
> and removes the unused http_write() prototype.
> The second patch does a bit of refactoring to http_connect() as well,
> splitting it up into two functions: http_send_request() and
> http_parse_header().

I talked to Bultje a bit on IRC and he wanted a small program to test
the patches with. I'm attaching it here for anyone else that might be

It's a small patch to one of the libmicrohttpd examples
(fileserver_example.c) that adds basic handling of Range/Content-Range.
To compile, svn checkout https://ng.gnunet.org/svn/libmicrohttpd/ ,
apply the patch and install in the usual fashion. Then run
src/examples/fileserver_example in a folder with some test files on say
port 8888. Finally, ffplay http://localhost:8888/foo.avi before and
after applying the patch. You'll see that it won't seek properly without
the patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: seekable_fileserver.patch
Type: text/x-patch
Size: 2184 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100518/8f7a033c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100518/8f7a033c/attachment.pgp>

More information about the ffmpeg-devel mailing list