avfilter/formats: fix format negotiation when multiple channel_layouts are provided

For example
ffmpeg -f lavfi -i sine -af "aformat=cl=stereo|5.1|7.1,lowpass,aformat=cl=7.1|5.1|stereo" -f null -

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2023-05-13 11:07:08 -03:00
parent c65e481330
commit b446ea22e9
2 changed files with 31 additions and 10 deletions
+1 -1
View File
@@ -441,7 +441,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx)
neg = ff_filter_get_negotiation(link);
av_assert0(neg);
for (neg_step = 1; neg_step < neg->nb_mergers; neg_step++) {
for (neg_step = 0; neg_step < neg->nb_mergers; neg_step++) {
const AVFilterFormatsMerger *m = &neg->mergers[neg_step];
void *a = FF_FIELD_AT(void *, m->offset, link->incfg);
void *b = FF_FIELD_AT(void *, m->offset, link->outcfg);