MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / parse_content_encoding

Function parse_content_encoding

libavformat/http.c:933–964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

931}
932
933static int parse_content_encoding(URLContext *h, const char *p)
934{
935 if (!av_strncasecmp(p, "gzip", 4) ||
936 !av_strncasecmp(p, "deflate", 7)) {
937#if CONFIG_ZLIB
938 HTTPContext *s = h->priv_data;
939
940 s->compressed = 1;
941 inflateEnd(&s->inflate_stream);
942 if (inflateInit2(&s->inflate_stream, 32 + 15) != Z_OK) {
943 av_log(h, AV_LOG_WARNING, "Error during zlib initialisation: %s\n",
944 s->inflate_stream.msg);
945 return AVERROR(ENOSYS);
946 }
947 if (zlibCompileFlags() & (1 << 17)) {
948 av_log(h, AV_LOG_WARNING,
949 "Your zlib was compiled without gzip support.\n");
950 return AVERROR(ENOSYS);
951 }
952#else
953 av_log(h, AV_LOG_WARNING,
954 "Compressed (%s) content, need zlib with gzip support\n", p);
955 return AVERROR(ENOSYS);
956#endif /* CONFIG_ZLIB */
957 } else if (!av_strncasecmp(p, "identity", 8)) {
958 // The normal, no-encoding case (although servers shouldn't include
959 // the header at all if this is the case).
960 } else {
961 av_log(h, AV_LOG_WARNING, "Unknown content coding: %s\n", p);
962 }
963 return 0;
964}
965
966// Concat all Icy- header lines
967static int parse_icy(HTTPContext *s, const char *tag, const char *p)

Callers 1

process_lineFunction · 0.85

Calls 2

av_strncasecmpFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected