#define OFFSET(x) offsetof(HTTPContext, x)
static const AVOption options[] = {
-{"chunksize", "use chunked transfer-encoding for posts, -1 disables it, 0 enables it", OFFSET(chunksize), FF_OPT_TYPE_INT64, 0, -1, 0 }, /* Default to 0, for chunked POSTs */
+{"chunksize", "use chunked transfer-encoding for posts, -1 disables it, 0 enables it", OFFSET(chunksize), FF_OPT_TYPE_INT64, {.dbl = 0}, -1, 0 }, /* Default to 0, for chunked POSTs */
{NULL}
};
static const AVClass httpcontext_class = {
- "HTTP", av_default_item_name, options, LIBAVUTIL_VERSION_INT
+ .class_name = "HTTP",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
};
static int http_connect(URLContext *h, const char *path, const char *hoststr,
int len = strlen(headers);
if (len && strcmp("\r\n", headers + len - 2))
- av_log(NULL, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
+ av_log(h, AV_LOG_ERROR, "No trailing CRLF found in HTTP header.\n");
av_strlcpy(s->headers, headers, sizeof(s->headers));
}
* don't abort until all headers have been parsed. */
if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) {
end += strspn(end, SPACE_CHARS);
- av_log(NULL, AV_LOG_WARNING, "HTTP error %d %s\n",
+ av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
s->http_code, end);
return -1;
}
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;