Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.
All of these were found by using av_warn_unused_result, demonstrating its utility.
Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.
Fixes: CID 1325680, 1325679, 1325678.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Do not assume that ff_request_frame() returning success
implies a frame has arrived in the FIFO.
Instead, just loop until a frame is in the FIFO.
It does not change anything since the same loop is present
in ff_request_frame(), confirmed by an assertion.
Use sizeof(void *) as its value, because AVFilterBufferRef is deprecated.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Previously it was partly only added to central functions called
internally, however if GCC would inline these into the public fuction, the
alignment attribute would not take effect.
Instead, add it to all public entry points to avoid these problems.
Signed-off-by: Martin Storsjö <martin@martin.st>
Previously it was partly only added to central functions called
internally, however if GCC would inline these into the public fuction, the
alignment attribute would not take effect.
Instead, add it to all public entry points to avoid these problems.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The functions which actually drive the filter graph by pushing
frames through it need to ensure an aligned stack for SIMD functions.
This fixes a crash in YADIF filter when using a mingw build in a MSVC
application.
Signed-off-by: Martin Storsjö <martin@martin.st>
Move validation from init to query_formats().
Accept the formats lists as binary options.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is mostly automated global search and replace
The deprecated aconvert filter is disabled, if it still has users
it should be updated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The functions which actually drive the filter graph by pushing
frames through it need to ensure an aligned stack for SIMD functions.
This fixes a crash in YADIF filter when using a mingw build in a MSVC application.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Note: the implementation could be more efficient, but at
the cost of more diff.
Most of the code from the following commit:
commit a2cd9be212
Author: Anton Khirnov <anton@khirnov.net>
Date: Fri May 4 19:22:38 2012 +0200
lavfi: add an audio buffer sink.
Adapted to call av_buffersink_get_frame_flags() instead of
accessing the frame directly.
Add a field to the AVBufferSinkParams for a list of accepted
channel counts.
Change the default value for the lists in AVBufferSinkParams
to NULL, to let lavfi fill them with something useful.
The fail_enomem path is unneeded because filters are uninited
on failure.
Implement av_buffersink_read() and av_buffersink_read_samples()
for ffmpeg's version of buffersink.
With this change, avconv linked against ffmpeg's libraries passes
the same number of tests whether it uses ffbuffersink or
buffersink_old.
With this change avconv compiled against libav and linked to ffmpegs libs
will run through the whole fate testsuite without any crashes.
857 tests pass, the remaining tests fail one way or another, which is
to be expected as avconv is not a drop in replacement for ffmpeg
The testsuite used was the ffmpeg fate testsuite, not libavs.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Use the init_opaque callback for the purpose.
Fix regression introduced in a5e8c41c28. In particular, fix lavfi
device in case a conversion to the supported (packed) formats is needed.