Ganesh Ajjanagadde
6aaac24d72
avfilter/all: propagate errors of functions from avfilter/formats
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>
9 years ago
Nicolas George
4982130d5a
lavfi/af_aresample: remove looping on request_frame().
9 years ago
Ronald S. Bultje
ad45121d56
options: mark av_get_{int,double,q} as deprecated.
Convert last users to av_opt_get_*() counterparts.
9 years ago
Michael Niedermayer
2ea8a48083
avfilter/af_aresample: Check ff_all_* for allocation failures
Fixes: signal_sigabrt_7ffff70eccc9_498_divx502.avi with memlimit 1572864
Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
d70e503ebc
avfilter/af_aresample: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
09024fe681
avfilter/af_aresample: Limit data per inserted packet
This avoids creating unwieldy large packets, which is allowed but
does not seem to be a good idea
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
97da68172a
avfilter/af_aresample: split flushing code out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Derek Buitenhuis
1dbc3e8ac8
avfilter/aresample: Check for memory alloc failure for out sample rates
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
10 years ago
Reimar Döffinger
3cc0f335fe
af_aresample: remove only use of array compound literals with non-const initializers in FFmpeg.
Some older compilers might have particular trouble with them,
and they do not really seem worth it to me.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
11 years ago
Alex Sukhanov
86b3435fc0
af_aresample: Fix timestamp of first padded PCM audio packet
Problem:
ffmpeg generated video file which had two audio packets with the same timestamp: last original audio packet and first padded audio packet.
Timestamp of first added audio packet by 'apad' fitler had the same value as last original audio packet. The problem was in 'aresample' fitler, which used next pts instead of current one.
As long as 'apad' and 'aresample' filters have separate mechanisms of timestamp calculation, they got the same values.
Command line:
ffmpeg -i <input_filename> -shortest -apad 512 -af asetnsamples=n=512 -b:a 1058400 -ac 1 -ar 44100 -async 0 -acodec pcm_s16le -sn -f matroska -y <output_file>
Fix:
Call swr_next_pts() function before swr_convert()
Tested:
FATE tests passed.
Fix has been tested in our Transcoder regression framework on ~10k test videos. It's about ~500k transcodes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ea6331b2c6
avfilter/af_aresample: Calculate output buffer size more precisely.
Fixes accumulation of data in case of significant silence injections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
b211607b5c
avfilter: various cosmetics
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Michael Niedermayer
ec0e0eb4c1
avfilter/vf_scale+aresample: minor simpification
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4f43e9b4af
avfilter/aresample: use init_dict system and set child AVOption context correctly
Parts of this commit are based on: 4fa1f52e
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
cd5f50a255
avfilter: avoid direct access to AVFrame.channels
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
c82bb2815b
lavfi/aresample: raise filter_frame() error.
12 years ago
Nicolas George
3d2adeb6f8
lavfi/af_aresample: fix info log for unknown layouts.
12 years ago
Nicolas George
2bd104c72a
lavfi/af_aresample: fix layout consistency check.
If the channel layout is unknown, lswr will internally use
the default one for the corresponding number of channels.
12 years ago
Nicolas George
b00502457a
lavfi/af_aresample: accept unknown channel layouts.
12 years ago
Stefano Sabatini
e06c147581
lavfi/aresample: fix style
Improve overall consistency/improve readability.
12 years ago
Nicolas George
238edd2fe3
lavfi: add a channels field to AVFilterLink.
Also: fix af_pan and af_aresample, that forgot to update
audio->channels.
12 years ago
Michael Niedermayer
616e6ffac6
aresample: increase n_out buffer size a bit to reduce delay in some corner cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
2d9d444051
lavfi: convert remaining input/output list compound literals to named objects.
This is following 568c70e79e
.
12 years ago
Michael Niedermayer
cd7febd33f
lavfi: replace filter_samples by filter_frame
Based on patch by Anton Khirnov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8d231e37af
af_aresample: consistently use ROUNDED_DIV
This fixes issues with negative timestamps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
4b5a12a2cb
af_aresample: fix rounding of negative timestamps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
014058abea
af_aresample: check ff_get_audio_buffer() failure
Fixes null pointer dereference
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c44a028e19
af_aresample: allocate at least 1 sample buffer. Fix null ptr dereference.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
1acd2f6ba7
Replace rest of libavutil/audioconvert.h with libavutil/channel_layout.h
Also remove it in once case when it is not needed.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
9ba2484ece
af_aresample: fix leak on alloc failure
Fixes CID733798
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
b5bea2f960
lavfi/aresample: set buffer properties after copy.
The aresample filter changes the format, layout and/or sample rate,
it can not copy them blindly from its input.
Related to trac ticket #1671 .
12 years ago
Stefano Sabatini
fda968aa8f
lavfi: decrease logging level of message showing initial parameters
Reduce log clutter, consistent with 1a49a169eb
.
13 years ago
Stefano Sabatini
972cad77fa
lavfi: remove unnecessary inclusion of libavcodec/avcodec.h in avfilter.h
libavfilter API was designed in order to be clarly distinguished from the
libavcodec API, including avcodec.h in avfilter.h is not going to help to
stick to this principle.
The inclusion of libavutil/audioconvert.h in many files was required
because avcodec.h includes audioconvert.h.
libavfilter/avcodec.h is where the lavc/lavfi interface should be
entirely placed.
13 years ago
Michael Niedermayer
62975afa68
af_aresample: fix sample_rate type.
should fix fate failures on 32bit x86 linux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
c9e183b490
lavfi: update some deprecated functions
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
be97675e6c
af_aresample: fix pts, they where off by a packet in the -async >0 case.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
411689b5e1
af_aresample: fix request_frame()
Fixes part of Ticket1341
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Clément Bœsch
b0b7a89b07
lavfi/aresample: print channel layouts and formats along with the rate.
13 years ago
Michael Niedermayer
21d8a80e30
af_aresample: use new swr API to pass and compensate PTS
This code is not only much more powerfull its also simpler
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
087d09b6d5
af_aresample: allocate a larger buffer so accumulated data can be returned quicker
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e17a039647
af_aresample: use extended_data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
96ac8663de
af_aresample: Consider the swresample delay during calculating timestamps.
The difference from this should be pretty small.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6ba692f8a7
af_aresample: fix rounding that led to sample accumulation in the buffers.
This fixes a regression that apparently was missed when switching to the
in af resampler
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
db6ef054f5
af_aresample: 10l fix, wrong timebase for next_pts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
847943bc51
aresample: add code to flush the internal swr buffer.
Inspired-by code from af_resample.c written by Anton Khirnov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
b3e1b95afa
aresample: check return code of swr_convert()
Issue found by comparing af_resample.c and af_aresample.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
b13d39bd81
av_aresample: Allow changing sample format and channel layout as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e3c6b61263
af_aresample: support all swresample parameters.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
47c2e52bc6
af_aresample: fix typo in query formats
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
efdc895fbd
lavfi: fix pts rescaling in the resampler
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago