Hi,

currently libavformat only allows seeking if a request with "Range: 
0-" results in a 206 reply from the HTTP server which includes a 
Content-Range header. But according to RFC 2616, the server may also 
reply with a normal 200 reply (which is more efficient for a request 
for the whole file). In fact Apache HTTPD 2.2.20 has changed the 
behaviour in this way and it looks like this change will be kept in 
future versions. The fix for libavformat is easy: Also look at the 
Accept-Ranges header.

There is some discussion at 
http://mail-archives.apache.org/mod_mbox/httpd-
dev/201109.mbox/%[email protected]%3E in case you are 
interested.

Cheers,
Stefan


--- http.c.orig	2011-09-03 17:06:13.749323624 +0200
+++ http.c	2011-09-03 17:09:10.037316409 +0200
@@ -265,6 +265,8 @@
                     s->filesize = atoll(slash+1);
             }
             h->is_streamed = 0; /* we _can_ in fact seek */
+        } else if (!strcasecmp (tag, "Accept-Ranges") && !strncmp (p, "bytes", 5)) {
+            h->is_streamed = 0;
         } else if (!strcasecmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) {
             s->filesize = -1;
             s->chunksize = 0;
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to