Muhammad Faiz
6af050d7d0
avfilter: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
8 years ago
Vittorio Giovara
88fd836a01
lavfi: Drop deprecated way of passing options for a few filters
Deprecated in 02/2013.
8 years ago
Marton Balint
01a19f77ca
avfilter/af_channelmap: add support for unknown input channel layouts
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
8 years ago
Ganesh Ajjanagadde
924fcac521
lavfi/af_channelmap: fix memory leak
Recent commits 6aaac24d72
and
3835554bf8
made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.
This commit addresses the issue of possible resource leaks when some intermediate
call fails.
Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual simulation
of malloc/realloc failures.
Fixes: CID 1338330.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
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
Michael Niedermayer
f5a6a8336f
avfilter/af_channelmap: Reorder operations to avoid memleak
Fixes CID1322346
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Anton Khirnov
22ecfcd4c7
af_channelmap: properly set the supported output channel layouts
The current code expects query_formats() to be called exactly once, it
will leak if it's not called at all (filter initialized, but never
configured or used) or try to read freed memory if it's called more than
once.
Found-by: James Almer <jamrial@gmail.com>
CC: libav-stable@libav.org
9 years ago
Michael Niedermayer
39867f3e09
avfilter/af_channelmap: Move ff_add_channel_layout() call to querry_format()
Avoids memleak if querry_formats is not called
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Marton Balint
625bd463cd
af_channelmap: fix number of channels
Fixes segfaults with the following command:
ffmpeg -f lavfi -i aevalsrc=0:c=stereo:n=1920 -af 'channelmap=0' test.ac3
Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
9f6431c8f6
avfilter/af_channelmap: Move potential dereference after NULL check in get_channel_idx()
Fixes CID1270822
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
579795b204
avfilter/af_channelmap: Check for missing argument in get_channel_idx()
Fixes null pointer dereference
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Reynaldo H. Verdejo Pinochet
32288234a2
libavfilter/af_channelmap: avoid derreferencing possible null
ff_all_channel_layouts() might return null on alloc failure.
Fixes CID1241517
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
10 years ago
Luca Barbato
f0e9594819
af_channelmap: Set the frame channel layout
Otherwise the frame would show the first layout matching the
channel count.
10 years ago
Michael Niedermayer
a62814abf4
avfilter/af_channelmap: Use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
e843612695
af_channelmap: fix ONE_STR mapping mode
get_channel() returns 0 on success
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
cd43ca0443
lavfi: do not export the filters from shared objects
11 years ago
Paul B Mahol
b211607b5c
avfilter: various cosmetics
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
beda41886e
lavfi/channelmap: make use of AVFILTER_DEFINE_CLASS
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Anton Khirnov
8aaab1113c
af_channelmap: ensure the output channel layout is valid.
12 years ago
Anton Khirnov
949c603ed9
af_channelmap: remove now unnecessary goto
Options are freed from the generic code now, there is no need to call
av_opt_free() from the filter.
12 years ago
Anton Khirnov
c0771a1ac6
af_channelmap: cosmetics, use an extra local variable to shorten the code
12 years ago
Anton Khirnov
aafed1175d
af_channelmap: sanity check input channel indices in all cases.
Fixes invalid reads from non-existing channels.
CC:libav-stable@libav.org
12 years ago
Anton Khirnov
d69a4177b9
lavfi: remove now unused args parameter from AVFilter.init
Conflicts:
libavfilter/avfilter.c
libavfilter/vf_drawtext.c
libavfilter/vf_lut.c
libavfilter/vf_select.c
libavfilter/vf_setpts.c
libavfilter/vsrc_color.c
libavfilter/vsrc_movie.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
837112c0c8
af_channelmap: fix uninitialized variable use introduced in ba8efac977
12 years ago
Anton Khirnov
c43a7ecad9
lavfi: remove now unused args parameter from AVFilter.init
12 years ago
Anton Khirnov
ba8efac977
af_channelmap: switch to an AVOptions-based system.
12 years ago
Clément Bœsch
96e4b00d62
lavfi: remove remaining forgotten min/rej perms.
12 years ago
Anton Khirnov
7e350379f8
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
12 years ago
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>
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
Anton Khirnov
565e4993c6
lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely
mythological and do not justify added code complexity.
12 years ago
Justin Ruggles
a903f8f087
Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
12 years ago
Mans Rullgard
67a68dcec2
af_channelmap: remove stray enum declaration
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
568c70e79e
lavfi: convert input/ouput list compound literals to named objects
A number of compilers, for example those from TI and IBM, choke on
these initialisers. The current style is also quite ugly.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Janne Grunau
1afd7a118f
af_channelmap: free old extended_data on reallocation
Prevents writes to freed memory and the leak of the old extended data.
Fixes CID732303.
12 years ago
Stefano Sabatini
42d621d131
lavfi: add priv class to filter definitions and flags to filter internal options
This allows the iteration callbacks to discover the internal class and
options, and show them when required.
12 years ago
Nicolas George
44127c0489
af_channelmap: fix permissions.
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Clément Bœsch
cc650cf029
Remove "Error parsing options string [...]" messages.
This reduces from 3 to 2 messages for the same syntax error in ffprobe,
and from 4 to 3 in filters.
12 years ago
Ronald S. Bultje
3db407038e
lavfi: use const for AVFilterPad declarations in all filters.
12 years ago
Anton Khirnov
cd99146253
lavfi: add error handling to filter_samples().
13 years ago
Anton Khirnov
a5e8c41c28
lavfi: remove 'opaque' parameter from AVFilter.init()
It is not used in any filters currently and is inherently evil. If
passing binary data to filters is required in the future, it should be
done with some AVOptions-based system.
13 years ago
Alex Converse
41e637e449
lavfi: Add the af_channelmap audio channel mapping filter.
Inspired by MPlayer's af_channels filter and SoX's remix effect.
13 years ago