http: Return meaningful error codes

(cherry picked from commit 55a215ba63d9fa79cd7ee265ee2e777ee86b200c)
http: Drop doxy comments

(cherry picked from commit 78b21c1d7177e1d61ad3c9225f67699da089aa7c)
http: K&R formatting cosmetics

(cherry picked from commit 7a2fddb4480121712df560cf619c1c3566cae3ff)
http: Refactor process_line

(cherry picked from commit 4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa)
http: Add support reading ICY metadata

Export the metadata as a icy_metadata_packet avoption.
Based on the work of wm4 and Alessandro Ghedini.

Bug-Id: https://bugs.debian.org/739936

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab)
http: Export Content-Type information

Bug-Id: https://bugs.debian.org/740421

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit e58c85b0686892960042232e51c77168b264838a)
http: Support setting custom User-Agent

Contextually make the default User-Agent use the common
"Name/Version" pattern.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ddfc98906373d1f17f6205cedd14c68d7a75995f)
http: Add support for selecting a request range

Comment from Reimar Döffinger included as pro memoria.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2ec33d27127251bbc45e1f88e60691ad59cf2319)
http: Always allow no-op seek

This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab)
http: Improve options descriptions

Add documentation where missing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit fe568b3d27ca2c5cca3878b2a7a3a968e605aec4)

Conflicts:
	libavformat/http.c
http: Allow setting a Content-Type for POST requests

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2572d07c1f0abd9e2bf3ed20dbe35c58f1dd6ac4)
http: Declare more parameters as const where possible

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e77a2ea9505863e50bf013706f66bf8b7325e524)
http: Properly initialize icy headers string

The icy_metadata_headers string never gets initialized, so,
during the first call to av_strlcatf() in parse_icy(),
strlen() will be called on a pointer to uninitialized memory.
At best this causes some garbage data to be left at the
start of the string.

By initializing icy_metadata_headers to the empty string, the
first call to strlen() will always return 0, so that data is
appended from the start of the string.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 6998a9f4c4e069f515c50614179f4cfc7d0184f5)