Diego Biurrun
b97f427fb5
lavf: Explicitly convert types at function pointer assignment
...
This fixes a number of "assignment from incompatible pointer type" warnings.
10 years ago
Michael Niedermayer
02484d1a93
avio: fix sizeof argument
...
CC: libav-stable@libav.org
Bug-Id: CID 732284
10 years ago
Gabriel Dume
4b1f5e5090
cosmetics: Write NULL pointer inequality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Carl Eugen Hoyos
99867fc0c4
Fix warning if https protocol was requested but isn't available.
11 years ago
Diego Biurrun
ec4f04da1a
avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const
11 years ago
Olivier Langlois
f78bc96b7c
lavf: Use av_gettime_relative()
...
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7aa3979b8c
avformat/avio: also set generic URL context options
...
This should have no effect currently as there are no such options yet.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Lukasz Marek
f495fbe76a
lavf/avio: fix ffurl_alloc error checks
...
ffurl_alloc doc says it returns >= 0 in case of success.
avio treats non-zero as errors.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
11 years ago
Alexander Strasser
db3c9701f4
lavf/avio: Introduce avio_find_protocol_name
...
Make it possible to find out what protocol will be chosen
for a given URL.
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
11 years ago
Martin Storsjö
0c5f839693
lavf: Remove a now useless parameter to ffurl_register_protocol
...
This was added in 9b07a2dc02
as an ABI hack to allow older
code built with lavf 52 to register protocols even if the size
of the URLProtocol struct was increased. Later, registering
protocols from outside of lavf was removed and this workaround
isn't needed any longer since lavf 53.
This removes an unchecked malloc and a memory leak for the cases
when this workaround actually was used - which it hasn't since
lavf 53.
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Derek Buitenhuis
25c7db7cc9
avio: Check for memory allocation failure of private data
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Luca Barbato
53151723e3
avio: K&R formatting cosmetics
11 years ago
Derek Buitenhuis
d206fd996b
avio: Check for memory allocation failure of private data
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Luca Barbato
ea71aafd68
avio: Use AVERROR_PROTOCOL_NOT_FOUND
...
When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).
Bug-Id: 577
CC: libav-stable@libav.org
11 years ago
Andrey Utkin
34fd21120d
retry_transfer_wrapper(): check for interrupt before operation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Carl Eugen Hoyos
1db88c33f2
Suggest recompilation with openssl or gnutls if the https protocol is not found.
...
Fixes ticket #2765 .
12 years ago
Michael Niedermayer
5d876be87a
avio: Handle AVERROR_EOF in the same way as the return value 0
...
This makes sure the ffurl_read_complete function actually
returns the number of bytes read, as the documentation of the
function says, even if the underlying protocol uses AVERROR_EOF
instead of 0.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
a46e578dda
avformat/avio: Fix EOF handiling of ffurl_read_complete()
...
Fixes Ticket2537
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
d9fad53f4b
lavf/avio: check for : in filenames for protocols.
...
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.
Fix trac ticket #2303 .
12 years ago
Nicolas George
3d7f4f8726
lavf/avio: check that the protocol supports the open mode.
...
Fix trac ticket #2139 .
12 years ago
Mans Rullgard
4521645b1a
avio: fix pointer type mismatches in avio_enum_protocols()
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Michael Niedermayer
a96577df38
avio: fix sizeof argument
...
Fixes CID732284
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d30351363f
url_alloc_for_protocol: fix use of uninitialized variable
...
Fixes CID703830
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
9a27fd12f3
avio: replace ETIMEDOUT by EIO
...
ETIMEDOUT is not available on all platforms
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Andrey Utkin
7870722592
Add 'rw_timeout' into URLContext
...
If set non-zero, limits duration of retry_transfer_wrapper() loop, thus
affects ffurl_read*(), ffurl_write()
Measured in microseconds.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Jordi Ortiz
d6b9da1178
avio: add (ff)url_get_multi_file_handle() for getting more than one fd
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Mans Rullgard
896bb0d742
Replace usleep() calls with av_usleep()
...
This reduces the dependency on unistd.h which is not available
on all systems.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Michael Niedermayer
edf96d631c
url: add ffurl_closep() which also sets the context pointer to NULL
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
f89aa6751c
lavf: use av_freep() in ffurl_close()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
f7c89705e4
avio: fix "discards const qualifier from pointer target type" warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Samuel Pitoiset
32d545e0a4
avio: Add a function for signalling end of reading/writing
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Nicolas George
12eeced8b4
avio: change ffurl_alloc return code.
...
If the designated protocol is not found, return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).
13 years ago
Michael Niedermayer
6679271700
avio: Fix "warning: initialization from incompatible pointer type"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Anton Khirnov
374e469b8d
lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
13 years ago
Anton Khirnov
2439f2ca82
lavf: remove disabled FF_API_OLD_AVIO cruft
13 years ago
Martin Storsjö
acb074301c
avio: Only do implicit network initialization for network protocols
...
The implicit network initialization is set to be removed in the
future, but is kept for compatibility. By not doing the implicit
initialization for non-network protocols, we avoid the warning
about avformat_network_init() not being called for these, where
it really doesn't make much sense.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
ad9e0ed170
avio: fix handling of , in urls
...
Fixes Ticket805
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
58030fc6c8
avio: Fix handling of filenames that contain :
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6161c41817
avio: Support private options in URLProtocols
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c12e1bd1bc
avio: allow any chars in protocols
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
45f511ece7
avio: Mark the old interrupt callback mechanism as deprecated
...
Prepare for removing it at an upcoming major bump.
13 years ago
Martin Storsjö
1dee0aca74
avio: add avio_open2, taking an interrupt callback and options
...
The interrupt callback has to be passed in during opening (setting it
after opening isn't enough), since a blocking open couldn't be
interrupted otherwise.
Options are passed down to procotols and also need to be available
during open() in most cases.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Anton Khirnov
ddffc2fdc3
avio: add support for passing options to protocols.
...
Not used anywhere yet, support for passing options from avio_open() will
follow.
13 years ago
Anton Khirnov
163a31136d
avio: add and use ffurl_protocol_next().
13 years ago
Martin Storsjö
6f1b7b3944
avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc
...
Change all uses of these function to pass the relevant
callback on.
13 years ago
Martin Storsjö
9957cdbfd5
avformat: Use ff_check_interrupt
13 years ago
Martin Storsjö
c4a090ddb5
avio: Add an internal utility function for checking the new interrupt callback
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Martin Storsjö
d10361b658
avio: Free URLContext private data allocated via AVOptions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
728e6d979b
avio: print a warning from ffurl_alloc() if no protocols are allocated.
...
Fixes Ticket618
Based on code by teratorn
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago