1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

408 Commits

Author SHA1 Message Date
Stephan Holljes
8cfaa76a5e lavf/http: Rudimentary error handling for HTTP requests received from clients.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
2015-06-06 09:24:43 +02:00
Stephan Holljes
bbcee92b6d lavf/http: Process HTTP header before sending response.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
2015-06-06 09:13:42 +02:00
Stephan Holljes
aa74401af8 lavf/http: Document method option.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
2015-06-06 09:13:41 +02:00
Michael Niedermayer
a649f36f75 avformat/http: Mark lower_proto as const in http_listen()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-10 15:01:36 +02:00
Rodger Combs
71b69df622 lavf/http: support HTTPS when listening
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-02 12:03:48 +02:00
Michael Niedermayer
40d552dae6 Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'
* commit '1a3eb042c704dea190c644def5b32c9cee8832b8':
  Replace av_dlog with normal av_log at trace level

Conflicts:
	ffplay.c
	libavdevice/fbdev_dec.c
	libavfilter/avfilter.c
	libavfilter/internal.h
	libavfilter/setpts.c
	libavfilter/src_movie.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fieldorder.c
	libavformat/assdec.c
	libavformat/avidec.c
	libavformat/flvdec.c
	libavformat/http.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/mov.c
	libavformat/mpegenc.c
	libavformat/mpegts.c
	libavformat/mpegtsenc.c
	libavformat/mux.c
	libavformat/mxfdec.c
	libavformat/nsvdec.c
	libavformat/oggdec.c
	libavformat/r3d.c
	libavformat/rtspdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 03:19:47 +02:00
Michael Niedermayer
22c0585a00 avformat/http: Fix 2 typos
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-19 14:26:40 +02:00
Vittorio Giovara
1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Michael Niedermayer
3668701f96 avformat/http: Return an error in case of prematurely ending data
Fixes Ticket 4039

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-19 13:01:48 +02:00
Rodger Combs
a4d58c97d0 lavf/http: handle case where the server returns a redirect during a seek
txoffer (e.g. http://tori.aoi-chan.com/ ) redirects to the same URI on your
first request, and serves the actual file on the second. It's stupid, but AFAIK
technically compliant. We'd previously see the server not handing back a Range
header and return an error; now, instead, we see that there's a redirect and
keep track of the offset we want while trying again at the new URL.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-13 11:18:50 +02:00
Stephan Holljes
b51027fd18 libavformat/http.c: Make http-listen work as an input stream.
With this patch http can be used to listen for POST data to be used as an input stream.

Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-11 23:10:44 +02:00
Stephan Holljes
6d8c27f951 libavformat/http.c: Fix missing parenthesis in http_listen()
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-06 22:17:58 +02:00
Stephan Holljes
4a58d757de lavf/http: add proof-of-concept http server.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Reviewed-By: Nicolas George <george@nsup.org>
2015-04-05 10:17:47 +02:00
Himangi Saraogi
919d13d238 avformat/http: Fix null check on allocated value
probably fixes CID 1292299

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-31 12:38:02 +02:00
Micah Galizia
c59654d67d avformat/http: replace cookies with updated values instead of appending forever
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-18 19:53:26 +01:00
Zhang Rui
3f375950f3 avformat/http: support auto reconnect
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-13 19:07:28 +01:00
Michael Niedermayer
a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun
daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Michael Niedermayer
bcd4447173 avformat/http: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 16:53:37 +01:00
Michael Niedermayer
deccb4d827 avformat/http: simplify chained_options copying
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 14:30:32 +01:00
Brandon Lees
ffaf2074eb Fix the timeout option not working when connecting to a HTTP url that requires authentication.
In http_open_cnx, the patch restores the AVDictionary if connection needs to be re-tried
because of a authentication/redirect status code.

Previously, if a 401/407/30x status code was encountered, http_open_cnx would restart at the redo label, but any options
used by the underlying protocol would be missing because they were removed by the first attempt.

Signed-off-by: Brandon Lees <brandon@n-hega.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 14:30:32 +01:00
Andrey Utkin
70c9d40008 avformat/http: pass return code from http_open_cnx_internal() on its failure
Previously, AVERROR(EIO) was returned on failure of
http_open_cnx_internal(). Now the value is passed to upper level, thus
it is possible to distinguish ECONNREFUSED, ETIMEDOUT, ENETUNREACH etc.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-23 20:58:21 +02:00
Andrey Utkin
81ce3f8e80 avformat/http: Use ff_http_averror()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-20 04:31:59 +02:00
Andrey Utkin
9d86ce783b avformat/http: Introduce ff_http_averror()
int ff_http_averror(int status_code, int default_averror)

This helper function returns AVERROR_ value from 3-digit HTTP status
code.

Second argument, default_averror, is used if no specific AVERROR_ is
available. It is introduced because in different places of code
different return codes are used - -1, AVERROR(EIO), AVERROR_INVALIDDATA.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-20 04:31:46 +02:00
Nicolas George
4bebce0617 lavf/http: remove special case for cookies attributes.
With the previous change, unknown attributes are all ignored,
as specified by the RFC.
2014-08-17 20:07:27 +02:00
Nicolas George
481cbc5ad5 lavf/http: fix cookie parsing.
The current code would use any unknown attribute-value pair
as the cookie value.
RFC 6265 states that the first key-value pair is the actual
cookie, and the attribute-value pairs only start after.

With the current code:
Set-Cookie: test=good_value; path=/; dummy=42
gives this:
Cookie: dummy=42
instead of this with the new code:
Cookie: test=good_value
2014-08-17 20:07:27 +02:00
Michael Niedermayer
60dbed6067 Merge commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867'
* commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867':
  cosmetics: Write NULL pointer inequality checks more compactly

Conflicts:
	libavcodec/dvdsubdec.c
	libavcodec/h263dec.c
	libavcodec/libxvid.c
	libavcodec/rv10.c
	libavcodec/utils.c
	libavformat/format.c
	libavformat/matroskadec.c
	libavformat/segment.c
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 21:26:12 +02:00
Gabriel Dume
4b1f5e5090 cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 05:34:13 -07:00
Michael Niedermayer
1e81b185ae Merge commit '7ccb847f0f1f28199fa254847b91b6e50fb92832'
* commit '7ccb847f0f1f28199fa254847b91b6e50fb92832':
  http: Reduce scope of a variable in parse_content_encoding()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 12:12:35 +02:00
Diego Biurrun
7ccb847f0f http: Reduce scope of a variable in parse_content_encoding()
Also fixes an unused variable warning with zlib disabled.
2014-08-15 09:37:38 +02:00
Michael Niedermayer
e260c8180e Merge commit '4e629ef80e62a54636cb46033998177dd08cf3ad'
* commit '4e629ef80e62a54636cb46033998177dd08cf3ad':
  http: Fix authentication, broken since 6a463e7fb

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 00:12:56 +02:00
Michael Niedermayer
313d75cd43 Merge commit '7e38903b5c86a759549e70647ae42bb22d353b14'
* commit '7e38903b5c86a759549e70647ae42bb22d353b14':
  http: enable icy metadata by default.

Conflicts:
	Changelog
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 22:54:31 +02:00
Michael Niedermayer
69a5cd9fea Merge commit '7601f9412a2d3387617a45966b65b452a632c27a'
* commit '7601f9412a2d3387617a45966b65b452a632c27a':
  http: export icecast metadata as an option with name "metadata".

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 22:52:53 +02:00
Martin Storsjö
4e629ef80e http: Fix authentication, broken since 6a463e7fb
The cur_*auth_type variables were set before the http_connect call
prior to 6a463e7fb - their sole purpose is to record the
authentication type used to do the latest request, since parsing
the http response sets the new type in the auth state.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-13 20:22:28 +03:00
Michael Niedermayer
9f7a2ecb29 Merge commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f'
* commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f':
  http: Stop reading after receiving the whole file for non-chunked transfers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 18:26:40 +02:00
Andrew Stone
7e38903b5c http: enable icy metadata by default.
It won't hurt servers that don't care about the header,
and those that do will include it by default.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:10:15 +00:00
Andrew Stone
7601f9412a http: export icecast metadata as an option with name "metadata".
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:09:05 +00:00
Martin Storsjö
8bf3bf69ad http: Stop reading after receiving the whole file for non-chunked transfers
Previously this logic was only used if the server didn't
respond with Connection: close, but use it even for that case,
if the server response is non-chunked.

Originally the http code has relied on Connection: close to close
the socket when the file/stream is received - the http protocol
code just kept reading from the socket until the socket was closed.
In f240ed18 we added a check for the file size, because some
http servers didn't respond with Connection: close (and wouldn't
close the socket) even though we requested it, which meant that the
http protocol blocked for a long time at the end of files, waiting
for a socket level timeout.

When reading over tls, trying to read at the end of the connection,
when the peer has closed the connection, can produce spurious (but
harmless) warnings. Therefore always voluntarily stop reading when
the specified file size has been received, if not using a chunked
transfer encoding. (For chunked transfers, we already return 0
as soon as we get the chunk header indicating end of stream.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-13 14:34:25 +03:00
Michael Niedermayer
b4d4f8f826 Merge commit '6a463e7fb4f028c52d2e2d054f9483f4fff492bc'
* commit '6a463e7fb4f028c52d2e2d054f9483f4fff492bc':
  http: Refactor http_open_cnx

See: c2a170ac0d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 03:44:11 +02:00
Rodger Combs
c2a170ac0d avformat/http: fix tls/tcp protocol after a 302 move in https
Fixes ticket 3824

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 03:33:40 +02:00
Luca Barbato
6a463e7fb4 http: Refactor http_open_cnx
Split return value handling from the actual opening.

Incidentally fixes the https -> http redirect issue reported by
Compn on behalf of rcombs.

CC: libav-stable@libav.org
2014-08-03 23:13:27 +02:00
Michael Niedermayer
8b59ab1af0 Merge commit 'ce2e858f5b3416c2d54f7f8c14e901f75c48b785'
* commit 'ce2e858f5b3416c2d54f7f8c14e901f75c48b785':
  http: K&R formatting cosmetics

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 02:08:14 +02:00
Diego Biurrun
ce2e858f5b http: K&R formatting cosmetics
Also comment some #endifs and reshuffle headers into canonical order.
2014-07-23 13:57:24 -07:00
Michael Niedermayer
016cca4504 Merge commit '7bdd2ff6825951f7a6a6008303acfce7c2a63532'
* commit '7bdd2ff6825951f7a6a6008303acfce7c2a63532':
  http: Use a constant for the supported header size

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 22:02:48 +02:00
Luca Barbato
7bdd2ff682 http: Use a constant for the supported header size 2014-07-22 16:38:26 +02:00
Michael Niedermayer
ab7c67905d Merge commit '389380c27915b0505fed538cd54c035c891fabd9'
* commit '389380c27915b0505fed538cd54c035c891fabd9':
  http: Do move the class instantiation in the conditional block

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 03:00:06 +02:00
Michael Niedermayer
e621e6cac6 Merge commit '28df1d24112c6ad0763985df2faeeb198cfbad69'
* commit '28df1d24112c6ad0763985df2faeeb198cfbad69':
  http: Provide an option to override the HTTP method

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 02:51:35 +02:00
Luca Barbato
389380c279 http: Do move the class instantiation in the conditional block
Remove a warning if https support is disabled.
2014-07-21 22:18:35 +02:00
Luca Barbato
28df1d2411 http: Provide an option to override the HTTP method
Certain servers accept only PUT as valid method.
2014-07-21 22:18:35 +02:00
Michael Niedermayer
56193d33be avformat/http: remove never twice executable loop
Fixes CID1197069

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-14 20:44:15 +02:00
wm4
686e662676 http: restructure http_connect error handling path
The authstr memory allocations make it annoying to error in the middle
of the header setup code, so apply the usual C error handling idiom to
make it easier to error at any point.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 05:56:35 +01:00
wm4
76c8fbc5f2 http: never send 'Cookie: (null)' to the server
If a domain has some cookies set, but matching the cookie fails due to
the port being different, get_cookies() succeeds, but sets cookies to
NULL. The caller of get_cookies() didn't check for the NULL value.

This also avoids passing NULL to libc string functions, which is
undefined behavior

Fixes Ticket2180

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-21 20:32:09 +01:00
Michael Niedermayer
11ed7ec092 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  http: Properly initialize icy headers string

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 23:24:19 +01:00
Michael Niedermayer
7e6c6c45ec Merge commit 'e77a2ea9505863e50bf013706f66bf8b7325e524'
* commit 'e77a2ea9505863e50bf013706f66bf8b7325e524':
  http: Declare more parameters as const where possible

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 20:50:29 +01:00
Alessandro Ghedini
6998a9f4c4 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>
2014-03-12 20:13:36 +01:00
Martin Storsjö
e77a2ea950 http: Declare more parameters as const where possible
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-12 13:24:58 +02:00
Michael Niedermayer
cd25412f59 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  http: Allow setting a Content-Type for POST requests

Conflicts:
	libavformat/http.c

See: c01d1d4ddf
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 04:53:54 +01:00
Michael Niedermayer
1cc9468289 Merge commit 'ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab'
* commit 'ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab':
  http: Always allow no-op seek

Conflicts:
	libavformat/http.c

See: 857841c1b6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 04:29:54 +01:00
Michael Niedermayer
76a939d0e5 Merge commit '2ec33d27127251bbc45e1f88e60691ad59cf2319'
* commit '2ec33d27127251bbc45e1f88e60691ad59cf2319':
  http: Add support for selecting a request range

Conflicts:
	doc/protocols.texi
	libavformat/http.c

See: d52882faef
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 04:12:30 +01:00
Michael Niedermayer
f36da16ede Merge commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f'
* commit 'ddfc98906373d1f17f6205cedd14c68d7a75995f':
  http: Support setting custom User-Agent

Conflicts:
	doc/protocols.texi
	libavformat/http.c

See: 2bb1c713cc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 03:45:16 +01:00
Michael Niedermayer
c03af3ac1c Merge commit 'e58c85b0686892960042232e51c77168b264838a'
* commit 'e58c85b0686892960042232e51c77168b264838a':
  http: Export Content-Type information

Conflicts:
	doc/protocols.texi
	libavformat/http.c

See: 76d851b656
See: 20899c54f0
See: 255ec768da
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 03:33:14 +01:00
Michael Niedermayer
ca2369cdee Merge commit '8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab'
* commit '8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab':
  http: Add support reading ICY metadata

Conflicts:
	doc/protocols.texi
	libavformat/http.c

See: a92fbe16f2
See: 636273d3d4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 03:18:12 +01:00
Michael Niedermayer
21d4c571fa Merge commit '4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa'
* commit '4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa':
  http: Refactor process_line

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 02:52:17 +01:00
Michael Niedermayer
df41cbee85 Merge commit '7a2fddb4480121712df560cf619c1c3566cae3ff'
* commit '7a2fddb4480121712df560cf619c1c3566cae3ff':
  http: K&R formatting cosmetics

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 02:45:34 +01:00
Michael Niedermayer
b752d02f42 Merge commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c'
* commit '78b21c1d7177e1d61ad3c9225f67699da089aa7c':
  http: Drop doxy comments

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 02:39:46 +01:00
Michael Niedermayer
03fd80dcb1 Merge commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c'
* commit '55a215ba63d9fa79cd7ee265ee2e777ee86b200c':
  http: Return meaningful error codes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 02:34:02 +01:00
Clément Bœsch
2572d07c1f http: Allow setting a Content-Type for POST requests
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-11 22:08:57 +01:00
Anssi Hannula
ab76d9f628 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>
2014-03-11 22:08:57 +01:00
Anssi Hannula
2ec33d2712 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>
2014-03-11 22:08:57 +01:00
Clément Bœsch
ddfc989063 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>
2014-03-11 22:08:57 +01:00
Michael Niedermayer
e58c85b068 http: Export Content-Type information
Bug-Id: https://bugs.debian.org/740421

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-11 22:08:57 +01:00
Luca Barbato
8075c3d8bb 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>
2014-03-11 22:08:57 +01:00
Alessandro Ghedini
fe568b3d27 http: Improve options descriptions
Add documentation where missing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-11 22:08:57 +01:00
Luca Barbato
4ff99ab3d7 http: Refactor process_line 2014-03-11 22:08:56 +01:00
Luca Barbato
7a2fddb448 http: K&R formatting cosmetics 2014-03-11 22:08:56 +01:00
Luca Barbato
78b21c1d71 http: Drop doxy comments 2014-03-11 22:08:56 +01:00
Luca Barbato
55a215ba63 http: Return meaningful error codes 2014-03-11 22:08:56 +01:00
Michael Niedermayer
c832bf0c38 Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master:
  lavd/avdevice: always free detected devices on error
  lavf/http: return error from seek on invalid whence
  lavf/http: return error on seeking to negative postion
  lavf/avio: fix ffurl_alloc error checks

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 02:04:18 +01:00
Lukasz Marek
1aa262f460 lavf/http: return error from seek on invalid whence
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-03-06 00:32:24 +01:00
Lukasz Marek
4ba6a534dc lavf/http: return error on seeking to negative postion
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-03-06 00:32:20 +01:00
wm4
636273d3d4 http: handle ICY in presence of chunked transfer encoding
Some http servers send an ICY stream in combination with chunked
transfer encoding. This case was handled incorrectly by the ICY code:
instead of handling chunked encoding before anything ICY related, both
were mixed.

Fix this by separating the ICY code from normal http reading. Move the
normal http reading to a new function http_read_stream(), while
http_read() handles ICY on top of http_read_stream().

The server identified itself as: cloudflare-nginx

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-05 22:49:36 +01:00
Eli Kara
da25a6573f avformat/http: Properly handle cookies that specify sub-domain where the URL.
Fixes ticket #3336

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-23 14:39:36 +01:00
Anssi Hannula
857841c1b6 avformat/http: always allow no-op seek
This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2014-01-03 15:05:48 +02:00
Anssi Hannula
d52882faef avformat/http: allow the caller to select a request range
Add AVOptions for setting the initial offset and the ending offset, so
they can be used for setting an appropriate Range header.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2013-12-31 03:18:53 +02:00
Michael Niedermayer
15b2ec57cc Merge commit 'be4edda6731a341d3fdeaa0e57753dc396790362'
* commit 'be4edda6731a341d3fdeaa0e57753dc396790362':
  http: Expose the content location via an AVOption

Conflicts:
	libavformat/http.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 17:48:45 +01:00
Michael Niedermayer
1d19f1b196 Merge commit '393d80cc278e2b2f5c9e7805db176e6f28335a33'
* commit '393d80cc278e2b2f5c9e7805db176e6f28335a33':
  http: Support relative URL redirection

Conflicts:
	libavformat/http.c

See: 4a4c93cb3f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 17:41:45 +01:00
Michael Niedermayer
6d648dcfc9 Merge commit '76267ecc82e3018e1913a2483d5fc47d0949cbd8'
* commit '76267ecc82e3018e1913a2483d5fc47d0949cbd8':
  http: Remove an unrelated and mistakenly set AVOption unit name

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 17:18:52 +01:00
Martin Storsjö
be4edda673 http: Expose the content location via an AVOption
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:07 +02:00
Zhang Rui
393d80cc27 http: Support relative URL redirection
In RFC 2616, this was explicitly said to be an absolute URL,
while in an upcoming draft [1] it is allowed to be relative as well.

[1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-25#section-7.1.2

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:04 +02:00
Martin Storsjö
76267ecc82 http: Remove an unrelated and mistakenly set AVOption unit name
This was due to a copypaste oversight.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:01 +02:00
Michael Niedermayer
04047b6166 avformat/http: print http headers at AV_LOG_DEBUG level
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-05 01:38:08 +01:00
wm4
3220a894f7 http: add hack to make streams served by MediaGateway not seekable
These streams are reported as seekable, but all tests show they are not,
and the server merely pretends the streams are seekable. The server
responds with:

    content-range: bytes 0-1999999999/2000000000

Range requests seem to be correctly answered, but the actual data
returned at the same offset is different. Assume this is a bug in the
server software. The server identifies itself as:

    Server: MediaGateway 3.5.2-001

Add a hack that checks the server name, and disables seeking in this
case.

Test URL: http://8283.live.streamtheworld.com:80/CBC_R1_VCR_H_SC

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 22:57:56 +01:00
Michael Niedermayer
b73900b8a6 avformat/http: fix cookies
Fixes Ticket3096

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-31 01:42:13 +01:00
Michael Niedermayer
d2db1bb7de avformat/http: dont fail with unknown Content-Encodings
Fixes: http://m1.file.xiami.com/282/23282/343749/1769075752_709488_l.mp3

Based-on-patch-by: Crossle Song <sxm@yixia.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-26 19:20:01 +02:00
Michael Niedermayer
0a6ce255ab Merge remote-tracking branch 'qatar/master'
* qatar/master:
  http: Check the auth string contents and not only the pointer

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-15 09:34:27 +02:00
Michael Niedermayer
708b32b6f7 http: Check the auth string contents and not only the pointer
This makes sure we don't send the Except: 100-continue header
if no authentication credentials have been provided.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-14 21:57:15 +03:00
Michael Niedermayer
5970f4bb02 avformat/http: check the auth string contents not the pointer which cannot be NULL
It appears this bug originates from a "work in progress" patch from
ffmpeg-devel that was heavily redesigned by and integrated in libav

And that patch even had a reply and review on the mailing list pointing
out that it had a bug.

This fixes a deadlock with ffserver

See: [FFmpeg-devel] [PATCH] Fix HTTP authentication problem for POST actions.
     [FFmpeg-devel] [PATCH 1/3] Introduce auth_phase flag, which will be true if authorization needs to be sent, but the type of authorization is not known yet Partial fix #3036
     [FFmpeg-devel] [PATCH 2/3] Only add Transfer-Encoding header when not in authorization phase, because server will wait (indefinitely) for data when receiving this header Partial fix #3036
     [FFmpeg-devel] [PATCH 3/3] Only allow posting data and/or forcing a 200 code, enabling posting isml chunks, -after- we did a possible first request to get a 403 from the server telling us which type of authentication to apply Final part fix #3036
See: 71549a857b
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-14 01:35:28 +02:00
Michael Niedermayer
6b1b63df85 Merge commit '71549a857b13edf4c4f95037de6ed5bb4c4bd4af'
* commit '71549a857b13edf4c4f95037de6ed5bb4c4bd4af':
  http: Support auth method detection for POST

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-14 00:37:01 +02:00
Michael Niedermayer
5dee3e8bb4 Merge commit 'eb8b05a3824a9fa85e20d603595ac8a3b83505d4'
* commit 'eb8b05a3824a9fa85e20d603595ac8a3b83505d4':
  http: Add an option for forcing basic authentication

Conflicts:
	libavformat/http.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-14 00:17:49 +02:00
Martin Storsjö
71549a857b http: Support auth method detection for POST
Inspired by a patch by Jakob van Bethlehem. But instead of doing
an empty POST first to trigger the WWW-Authenticate header (which
would succeed if no auth actually was required), add an Expect:
100-continue header, which is meant to be used exactly for
cases like this.

The header is added if doing a post, and the user has specified
authentication but we don't know the auth method yet.

Not all common HTTP servers support the Expect: 100-continue header,
though, so we only try to use it when it really is needed. The user
can request it to be added for other POST requests as well via
an option - which would allow the caller to know immediately that
the POST has failed (e.g. if no auth was provided but the server
required it, or if the target URL simply doesn't exist).

This is only done for write mode posts (e.g. posts without pre-set
post_data) - for posts with pre-set data, we can just redo the post
if it failed due to 401.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-13 12:59:03 +03:00
Martin Storsjö
eb8b05a382 http: Add an option for forcing basic authentication
The default is to autodetect the auth method. This does require one
extra request (and also closing and reopening the http connection).
For some cases such as HTTP POST, the autodetection is not handled
properly (yet).

No option is added for digest, since this method requires getting
nonce parameters from the server first and can't be used straight
away like Basic.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-13 12:59:03 +03:00
Michael Niedermayer
689a1bd917 Merge commit '5c53bf7aaf03748464cbf978bffe7ffdb71112b1'
* commit '5c53bf7aaf03748464cbf978bffe7ffdb71112b1':
  http: Pass options through to the nested protocol

Conflicts:
	libavformat/http.c

See: b6f435fbc8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-27 10:38:04 +02:00
Martin Storsjö
5c53bf7aaf http: Pass options through to the nested protocol
When passing a dict to the nested protocol, it will consume
the used options from it, so a separate copy needs to be used
when reopening the connection multiple times.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:16 +03:00
Michael Niedermayer
39a69d9dfb Merge commit '0f51c398beac87682b2249662b97e30512f7868c'
* commit '0f51c398beac87682b2249662b97e30512f7868c':
  http: Support reading gzip/deflate compressed data
  utvideoenc: use av_image_copy_plane()

Conflicts:
	libavformat/http.c
See: b09d86c636
See: 6bab3430a7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-29 12:00:17 +02:00
Zhang Rui
0f51c398be http: Support reading gzip/deflate compressed data
Derived from VLC's http module.
Original authors:
  Antoine Cellerier <dionoea@videolan.org>
  Sébastien Escudier <sebastien-devel@celeos.eu>
  Rémi Duraffort <ivoire@videolan.org>
  Rémi Denis-Courmont <remi@remlab.net>
  Francois Cartegnie <fcvlcdev@free.fr>

Normally, http servers shouldn't send this to us since we
don't advertise it with an Accept-Encoding header, but some
servers still do it anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-28 18:39:49 +03:00
Zhang Rui
6bab3430a7 avformat/http: support reading compressed data
Derived from VLC's http module.
Original authors:
  Antoine Cellerier <dionoea@videolan.org>
  Sébastien Escudier <sebastien-devel@celeos.eu>
  Rémi Duraffort <ivoire@videolan.org>
  Rémi Denis-Courmont <remi@remlab.net>
  Francois Cartegnie <fcvlcdev@free.fr>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-24 04:15:15 +02:00
Zhang Rui
4a4c93cb3f avformat/http: support relative url redirection
see also http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-17#section-9.5

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-04 16:16:03 +02:00
wm4
a92fbe16f2 lavf/http: add support for reading streamcast metadata
Allow applications to request reading streamcast metadata. This uses
AVOptions as API, and requires the application to explicitly request
and read metadata. Metadata can be updated mid-stream; if an
application is interested in that, it has to poll for the data by
reading the "icy_metadata_packet" option in regular intervals.

There doesn't seem to be a nice way to transfer the metadata in a nicer
way. Converting the metadata to ID3v2 tags might be a nice idea, but
the libavformat mp3 demuxer doesn't seem to read these tags mid-stream,
and even then we couldn't guarantee that tags are not inserted in the
middle of mp3 packet data.

This commit provides the minimum to enable applications to retrieve
this information at all.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-07-02 02:00:56 +02:00
Clément Bœsch
de12b454f2 lavf/http: remove Mozilla/5.0 from user agent.
It is notably known to break playback on http streaming servers who use
the user agent to guess if it's a browser (to display a summary) or a
player (to stream the audio data).

This reverts 1fabd95.

Fixes Ticket #2663.
2013-06-17 17:06:11 +02:00
Carl Eugen Hoyos
e9df8f7725 Accept incomplete http cookies without domain.
Works around a bug in some servers that apparently send incomplete cookies.
Fixes a part of ticket #2619.

Reviewed-by: Micah Galizia
2013-06-10 10:52:40 +02:00
Clément Bœsch
30e6a02c23 lavf/http: remove duplicated dec flag. 2013-04-19 14:44:58 +02:00
Clément Bœsch
1fabd95035 lavf/http: use a more compatible default user agent.
Fixes Ticket 2265.
2013-04-06 21:08:32 +02:00
Reimar Döffinger
efa7f42020 Use the avstring.h locale-independent character type functions
Make sure the behavior does not change with the locale.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 15:16:36 +02:00
Reimar Döffinger
88d55b827d Remove incorrect use of ctype.h functions.
As far as I can tell the code should not change behaviour
depending on locale in any of these places.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-03-03 21:44:10 +01:00
Michael Niedermayer
03678a32bc Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: Add a fate test for the noproxy pattern matching
  lavf: Handle the environment variable no_proxy more properly

Conflicts:
	libavformat/Makefile
	libavformat/internal.h
	libavformat/tls.c
	libavformat/utils.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-28 13:13:04 +01:00
Martin Storsjö
de9cd1b173 lavf: Handle the environment variable no_proxy more properly
The handling of the environment variable no_proxy, present since
one of the initial commits (de6d9b6404), is inconsistent with
how many other applications and libraries interpret this
variable. Its bare presence does not indicate that the use of
proxies should be skipped, but it is some sort of pattern for
hosts that does not need using a proxy (e.g. for a local network).

As investigated by Rudolf Polzer, different libraries handle this
in different ways, some supporting IP address masks, some supporting
arbitrary globbing using *, some just checking that the pattern matches
the end of the hostname without regard for whether it actually is
the right domain or a domain that ends in the same string.

This simple logic should be pretty similar to the logic used by
lynx and curl.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-27 21:32:13 +02:00
Micah Galizia
c8ea5ccd5d fix memory leak on string reassign
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes CID968584 and CID968585
2013-01-21 02:50:02 +01:00
Micah Galizia
0b80a12184 lavf/http: add HTTP protocol cookie support
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-01-15 22:26:30 +01:00
Stefano Sabatini
255ec768da lavf/http: fix/extend option descriptions
In particular, favor predicative form over nominal description of the set
parameter. This is more globally consistent.
2013-01-12 10:41:56 +01:00
Michael Niedermayer
0a60f83075 http: dont null check p, its unneeded
Fixes CID747740
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 00:03:23 +01:00
Michael Niedermayer
20899c54f0 http/utils: rename "demuxer" to mime_type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-10 01:00:16 +01:00
Michael Niedermayer
68bc012190 http/utils: move mime -> demuxer maping from http to utils
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-09 20:24:49 +01:00
Michael Niedermayer
76d851b656 http: export ICY content type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-09 19:12:34 +01:00
Clément Bœsch
c01d1d4ddf http: add -content_type user option. 2012-10-24 22:15:31 +02:00
Michael Niedermayer
cd6f5c4895 Merge commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702'
* commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702':
  swscale: Do not make ff_ symbols globally visible.
  rtspdec: use av_strlcpy for writing into fixed size buffer
  g722enc: fix size argument in memset
  http: use av_strlcpy instead of strcpy() without size checks
  avfilter: correct memcpy size avfilter_copy_buf_props()
  lavc: split asv12 encoder/decoder

Conflicts:
	libavcodec/asvdec.c
	libavfilter/buffer.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-10 14:07:05 +02:00
Janne Grunau
4a7c0c4555 http: use av_strlcpy instead of strcpy() without size checks
Fixes CID700730.
2012-10-09 21:05:14 +02:00
Andrey Utkin
b6f435fbc8 http: add 'timeout' AVOption
This option is passed though to underlying tcp protocol context

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-09 17:47:14 +02:00
Duncan Salerno
8a33210d1b http: prevent the Range header being sent when seekability probing isnt used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-05 05:13:28 +02:00
Duncan Salerno
dd1e6b2a13 http: add option to prevent probing for HTTP seekability
Add an tri-state (seek, non seek, automatic detection) option to HTTP to control seekability (default: automatic).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-05 05:11:58 +02:00
Michael Niedermayer
2acb5cd907 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libopus: Remap channels using libopus' internal remapping.
  Opus decoder using libopus
  avcodec: document the use of AVCodecContext.delay for audio decoding
  vc1dec: add flush function for WMV9 and VC-1 decoders
  http: Increase buffer sizes to cope with longer URIs
  nutenc: const correctness for ff_put_v_trace/put_s_trace function arguments
  h264_refs: Fix debug tprintf argument types
  golomb: const correctness for get_ue()/get_se() function arguments
  get_bits: const correctness for get_bits_trace()/get_xbits_trace() arguments

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/version.h
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-28 13:54:40 +02:00
Duncan Salerno
8bd324e9e4 http: Increase buffer sizes to cope with longer URIs
Use the MAX_URL_SIZE define where applicable. Increase buffer
sizes for all buffers that need to fit a long pathname - buffers
that need to fit only the hostname (and other short strings, but
not the pathname - such as "headers" in http_connect) are kept
at 1024 bytes for now.

Also increase the max line length in http_read_header, since it
might need to contain a full url for Location: redirects.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-28 00:09:38 +03:00
Reimar Döffinger
033f53fb8f Document why we always send a Range HTTP header.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-09-23 15:40:17 +02:00
Michael Niedermayer
f0bb88e2bc Revert "http: only send range header when necessary"
This reverts commit 48cf0f1c18.
This can cause problems with seekability detection
2012-09-23 13:21:35 +02:00
Duncan Salerno
48cf0f1c18 http: only send range header when necessary
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-23 02:36:08 +02:00
Duncan Salerno
0a8cc1179a http: larger buffer for long URIs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-23 02:35:42 +02:00
Michael Niedermayer
d46c1c72e4 Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9'
* commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9':
  avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member

Conflicts:
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options_table.h
	libavcodec/snowenc.c
	libavcodec/tiffenc.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/af_amix.c
	libavfilter/af_asyncts.c
	libavfilter/af_join.c
	libavfilter/buffersrc.c
	libavfilter/src_movie.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawtext.c
	libavformat/http.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/movenc.c
	libavformat/mpegenc.c
	libavformat/mpegtsenc.c
	libavformat/options_table.h
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-05 14:33:32 +02:00
Martin Storsjö
e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Michael Niedermayer
7803a04041 http: try to detect live akamai streams and dont enable seeking for them
Fixes ticket1320

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-28 00:18:24 +02:00
Michael Niedermayer
4da42ebe44 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  MS Screen 1 decoder
  aacdec: Fix popping channel layouts.
  av_gettime: support Win32 without gettimeofday()
  Use av_gettime() in various places
  Move av_gettime() to libavutil
  dct-test: use emms_c() from libavutil instead of duplicating it
  mov: fix operator precedence bug
  mathematics.h: remove a couple of math defines
  Remove unnecessary inclusions of [sys/]time.h
  lavf: remove unnecessary inclusions of unistd.h
  bfin: libswscale: add const where appropriate to fix warnings
  bfin: libswscale: remove unnecessary #includes
  udp: Properly check for invalid sockets
  tcp: Check the return value from getsockopt
  network: Use av_strerror for getting error messages
  udp: Properly print error from getnameinfo
  mmst: Use AVUNERROR() to convert error codes to the right range for strerror
  network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows
  rtmp: Reduce the number of idle posts sent by sleeping 50ms

Conflicts:
	Changelog
	configure
	libavcodec/aacdec.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/dct-test.c
	libavcodec/version.h
	libavformat/riff.c
	libavformat/udp.c
	libavutil/Makefile
	libswscale/bfin/yuv2rgb_bfin.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-20 20:47:46 +02:00
Mans Rullgard
4e5a514813 lavf: remove unnecessary inclusions of unistd.h
These files do not use anything provided by unistd.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:30 +01:00
Michael Niedermayer
cabbd271a5 Merge remote-tracking branch 'qatar/master'
* qatar/master: (24 commits)
  flvdec: remove incomplete, disabled seeking code
  mem: add support for _aligned_malloc() as found on Windows
  lavc: Extend the documentation for avcodec_init_packet
  flvdec: remove incomplete, disabled seeking code
  http: replace atoll() with strtoll()
  mpegts: remove unused/incomplete/broken seeking code
  af_amix: allow float planar sample format as input
  af_amix: use AVFloatDSPContext.vector_fmac_scalar()
  float_dsp: add x86-optimized functions for vector_fmac_scalar()
  float_dsp: Move vector_fmac_scalar() from libavcodec to libavutil
  lavr: Add x86-optimized function for flt to s32 conversion
  lavr: Add x86-optimized function for flt to s16 conversion
  lavr: Add x86-optimized functions for s32 to flt conversion
  lavr: Add x86-optimized functions for s32 to s16 conversion
  lavr: Add x86-optimized functions for s16 to flt conversion
  lavr: Add x86-optimized function for s16 to s32 conversion
  rtpenc: Support packetizing iLBC
  rtpdec: Add a depacketizer for iLBC
  Implement the iLBC storage file format
  mov: Support muxing/demuxing iLBC
  ...

Conflicts:
	Changelog
	configure
	libavcodec/avcodec.h
	libavcodec/dsputil.c
	libavcodec/version.h
	libavformat/movenc.c
	libavformat/mpegts.c
	libavformat/version.h
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-19 20:53:27 +02:00
Ronald S. Bultje
51a2b5546b http: replace atoll() with strtoll() 2012-06-19 01:00:13 +01:00
Michael Niedermayer
82edf6727f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavr: add x86-optimized functions for mixing 1-to-2 s16p with flt coeffs
  lavr: add x86-optimized functions for mixing 1-to-2 fltp with flt coeffs
  Add Dolby/DPLII downmix support to libavresample
  vorbisdec: replace div/mod in loop with a counter
  fate: vorbis: add 5.1 surround test
  rtpenc: Allow requesting H264 RTP packetization mode 0
  configure: Sort the library listings in the help text alphabetically
  dwt: remove variable-length arrays
  RTMPT protocol support
  http: Properly handle chunked transfer-encoding for replies to post data
  http: Fail reading if the connection has gone away
  amr: Mark an array const
  amr: More space cleanup
  rtpenc: Fix memory leaks in the muxer open function

Conflicts:
	Changelog
	configure
	doc/APIchanges
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-18 20:07:00 +02:00
Martin Storsjö
35127bf156 http: Properly handle chunked transfer-encoding for replies to post data
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:56:56 +03:00
Martin Storsjö
eb564b23a3 http: Fail reading if the connection has gone away
This can happen if doing a new request using the same socket,
but the new request failed, which clears the urlcontext.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-17 22:56:51 +03:00
Michael Niedermayer
fbc5e0fae1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  http: Add the url_shutdown function for https, too
  http: Simplify code by removing a local variable
  http: Clear the old URLContext pointer when closed
  tcp: Try enabling SO_REUSEADDR when listening
  tcp: Check the return values from bind and accept
  avisynth: Make sure the filename passed to avisynth is in the right code page

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-01 19:59:39 +02:00
Martin Storsjö
dbaf79c9d7 http: Add the url_shutdown function for https, too
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:31 +03:00
Martin Storsjö
5952564185 http: Simplify code by removing a local variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:29 +03:00
Martin Storsjö
3cbcfa2dec http: Clear the old URLContext pointer when closed
This fixes issues with opening http urls that have authentication
or redirects, introduced in commit e999b641.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-01 18:38:28 +03:00
Michael Niedermayer
f218121a4d http: use ffurl_closep()
Fixes Ticket1383

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-01 14:48:17 +02:00