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

Tomas Härdin tomas.hardin
Tue May 11 09:58:54 CEST 2010


Hi

While debugging problems with lavf communicating with libmicrohttpd (aka
MHD) I discovered that seeking in a resource on a server based on that
library doesn't work. Note that MHD uses chunked encoding when streaming
data out of it (to lavf in this case).

The problem is that http_seek() calls http_open_cnx(), which in turn
calls http_connect() with chunksize >= 0 (since chunked encoding was
detected when it connected). This in turn causes the headers to be sent
using chunked encoding due to the call to http_write() on line 282,
which obviously is bogus.

Attached is a patch that changes http_connect() to not rely on this
behavior of http_write(). http_write() instead always uses chunked
encoding, while http_connect() simply uses url_write().

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chunked_seeking.patch
Type: text/x-patch
Size: 1648 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100511/7c94aa2a/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/20100511/7c94aa2a/attachment.pgp>



More information about the ffmpeg-devel mailing list