]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/http.c
matroskaenc: Implement support for ALAC
[ffmpeg] / libavformat / http.c
index 0314557b2c0dcbc66d554d6ff2ce4c68e63e784d..5355bdc68df7adc7dda3c6fe39085d22c2d15ba9 100644 (file)
@@ -56,6 +56,7 @@ typedef struct {
     int multiple_requests;  /**< A flag which indicates if we use persistent connections. */
     uint8_t *post_data;
     int post_datalen;
+    int is_akamai;
 } HTTPContext;
 
 #define OFFSET(x) offsetof(HTTPContext, x)
@@ -317,7 +318,8 @@ static int process_line(URLContext *h, char *line, int line_count,
                 if ((slash = strchr(p, '/')) && strlen(slash) > 0)
                     s->filesize = strtoll(slash+1, NULL, 10);
             }
-            h->is_streamed = 0; /* we _can_ in fact seek */
+            if (!s->is_akamai || s->filesize != 2147483647)
+                h->is_streamed = 0; /* we _can_ in fact seek */
         } else if (!av_strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) {
             h->is_streamed = 0;
         } else if (!av_strcasecmp (tag, "Transfer-Encoding") && !av_strncasecmp(p, "chunked", 7)) {
@@ -332,6 +334,8 @@ static int process_line(URLContext *h, char *line, int line_count,
         } else if (!av_strcasecmp (tag, "Connection")) {
             if (!strcmp(p, "close"))
                 s->willclose = 1;
+        } else if (!av_strcasecmp (tag, "Server") && !av_strcasecmp (p, "AkamaiGHost")) {
+            s->is_akamai = 1;
         }
     }
     return 1;