[FFmpeg-devel] [PATCH] aconvert filter needs to configure samplerates
Michael Niedermayer
michaelni at gmx.at
Mon Jun 4 23:56:24 CEST 2012
On Mon, Jun 04, 2012 at 02:00:45PM -0400, Andrew Wason wrote:
> aconvert filter causes a crash when merging formats because it doesn't
> configure samplerates.
>
> ffmpeg -i test.mov -af aresample=8000,aconvert -f s16le -vn -y /tmp/c.raw
>
> In gdb:
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
> 0x000000010005fb38 in ff_merge_samplerates (a=0x10321ea30, b=0x0) at
> formats.c:114
> 114 if (a->format_count && b->format_count) {
>
>
> Andrew
> af_aconvert.c | 5 +++++
> 1 file changed, 5 insertions(+)
> b55bc25ae6eb0bec11143fb017244efb76cec996 aconvert.diff
> diff --git a/libavfilter/af_aconvert.c b/libavfilter/af_aconvert.c
> index 9e27856..df76d20 100644
> --- a/libavfilter/af_aconvert.c
> +++ b/libavfilter/af_aconvert.c
> @@ -95,6 +95,11 @@ static int query_formats(AVFilterContext *ctx)
> ff_channel_layouts_ref(ff_all_channel_layouts(),
> &outlink->in_channel_layouts);
>
> + formats = ff_all_samplerates();
> + if (!formats)
> + return AVERROR(ENOMEM);
> + ff_set_common_samplerates(ctx, formats);
instead of adding this to every filter i would suggest that a wraper
is added to call ->query_formats() and that fills all fields with
defaults that the filters query_formats() left blank
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120604/0a770c51/attachment.asc>
More information about the ffmpeg-devel
mailing list