summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-29 11:57:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-29 12:00:17 +0200
commit39a69d9dfbc7d527018546d7a1a1be99d82dceeb (patch)
tree4a5d975ff949fba5b0608302efc74d5bf5657bb1 /libavformat/http.c
parent0c6f382e855749ec45224a74ba5e07d1db52e6a0 (diff)
parent0f51c398beac87682b2249662b97e30512f7868c (diff)
Merge commit '0f51c398beac87682b2249662b97e30512f7868c'
* commit '0f51c398beac87682b2249662b97e30512f7868c': http: Support reading gzip/deflate compressed data utvideoenc: use av_image_copy_plane() Conflicts: libavformat/http.c See: b09d86c6366f2933d7bec430486d9d56bf98f7b6 See: 6bab3430a775183f2f9acbd91d1376c71e87c026 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 7b5b21ca88..3edddbfb17 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -410,17 +410,26 @@ static int process_line(URLContext *h, char *line, int line_count,
#if CONFIG_ZLIB
s->compressed = 1;
inflateEnd(&s->inflate_stream);
- if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK)
- av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s",
+ if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
+ av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
s->inflate_stream.msg);
- if (zlibCompileFlags() & (1 << 17))
- av_log(h, AV_LOG_WARNING, "Your zlib was compiled without gzip support.");
+ return AVERROR(ENOSYS);
+ }
+ if (zlibCompileFlags() & (1 << 17)) {
+ av_log(h, AV_LOG_WARNING, "Your zlib was compiled without gzip support.\n");
+ return AVERROR(ENOSYS);
+ }
#else
- av_log(h, AV_LOG_WARNING, "Compressed(%s) content, need zlib support", p);
+ av_log(h, AV_LOG_WARNING, "Compressed (%s) content, need zlib with gzip support\n", p);
+ return AVERROR(ENOSYS);
#endif
+ } else if (!av_strncasecmp(p, "identity", 8)) {
+ // The normal, no-encoding case (although servers shouldn't include
+ // the header at all if this is the case).
+ } else {
+ av_log(h, AV_LOG_WARNING, "Unknown content coding: %s\n", p);
+ return AVERROR(ENOSYS);
}
- else
- av_log(h, AV_LOG_WARNING, "Unknown content coding: %s", p);
}
}
return 1;
@@ -736,7 +745,7 @@ static int http_buf_read_compressed(URLContext *h, uint8_t *buf, int size)
ret = inflate(&s->inflate_stream, Z_SYNC_FLUSH);
if (ret != Z_OK && ret != Z_STREAM_END)
- av_log(h, AV_LOG_WARNING, "inflate return value: %d, %s", ret, s->inflate_stream.msg);
+ av_log(h, AV_LOG_WARNING, "inflate return value: %d, %s\n", ret, s->inflate_stream.msg);
return size - s->inflate_stream.avail_out;
}