X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Faf_channelmap.c;fp=libavfilter%2Faf_channelmap.c;h=9e95a98d00a60e24452f43f43eb31aeaa3287187;hb=6aaac24d72a7da631173209841a3944fcb4a3309;hp=37b47b2d7bb85e21aeddc586ba895f2758c2c123;hpb=8ededd583622359062622cf008144a1511d50bbd;p=ffmpeg diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 37b47b2d7bb..9e95a98d00a 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -289,18 +289,15 @@ static int channelmap_query_formats(AVFilterContext *ctx) ChannelMapContext *s = ctx->priv; AVFilterChannelLayouts *layouts; AVFilterChannelLayouts *channel_layouts = NULL; + int ret; layouts = ff_all_channel_layouts(); - if (!layouts) - return AVERROR(ENOMEM); - - ff_add_channel_layout(&channel_layouts, s->output_layout); - - ff_set_common_formats(ctx, ff_planar_sample_fmts()); - ff_set_common_samplerates(ctx, ff_all_samplerates()); - - ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts); - ff_channel_layouts_ref(channel_layouts, &ctx->outputs[0]->in_channel_layouts); + if ((ret = ff_add_channel_layout (&channel_layouts, s->output_layout )) < 0 || + (ret = ff_set_common_formats (ctx , ff_planar_sample_fmts() )) < 0 || + (ret = ff_set_common_samplerates (ctx , ff_all_samplerates() )) < 0 || + (ret = ff_channel_layouts_ref (layouts , &ctx->inputs[0]->out_channel_layouts)) < 0 || + (ret = ff_channel_layouts_ref (channel_layouts , &ctx->outputs[0]->in_channel_layouts)) < 0) + return ret; return 0; }