Commit 39a69d9d authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '0f51c398'

* commit '0f51c398':
  http: Support reading gzip/deflate compressed data
  utvideoenc: use av_image_copy_plane()

Conflicts:
	libavformat/http.c
See: b09d86c6
See: 6bab3430Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 0c6f382e 0f51c398
...@@ -410,17 +410,26 @@ static int process_line(URLContext *h, char *line, int line_count, ...@@ -410,17 +410,26 @@ static int process_line(URLContext *h, char *line, int line_count,
#if CONFIG_ZLIB #if CONFIG_ZLIB
s->compressed = 1; s->compressed = 1;
inflateEnd(&s->inflate_stream); inflateEnd(&s->inflate_stream);
if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s", av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
s->inflate_stream.msg); s->inflate_stream.msg);
if (zlibCompileFlags() & (1 << 17)) return AVERROR(ENOSYS);
av_log(h, AV_LOG_WARNING, "Your zlib was compiled without gzip support."); }
if (zlibCompileFlags() & (1 << 17)) {
av_log(h, AV_LOG_WARNING, "Your zlib was compiled without gzip support.\n");
return AVERROR(ENOSYS);
}
#else #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 #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; return 1;
...@@ -736,7 +745,7 @@ static int http_buf_read_compressed(URLContext *h, uint8_t *buf, int size) ...@@ -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); ret = inflate(&s->inflate_stream, Z_SYNC_FLUSH);
if (ret != Z_OK && ret != Z_STREAM_END) 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; return size - s->inflate_stream.avail_out;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment