avfilter/af_aresample: fix layout comparison when applying downmix coeffs

out_layout at this point is a zeroed struct, and even after being filled below in the code
it's ensured it will be the same as outlink->side_data.
The actual check should be between inlink and outlink layouts. If they differ, then swr
will do remixing and as such the downmix info side data will no longer be valid for any
filter or encoder down the chain.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2026-05-25 19:03:45 -03:00
parent fd9e4fa081
commit 971da26361
+1 -1
View File
@@ -177,7 +177,7 @@ static int config_output(AVFilterLink *outlink)
av_opt_set_double(aresample->swr, "lfe_mix_level", di->lfe_mix_level, 0);
av_opt_set_int(aresample->swr, "matrix_encoding", matrix_encoding, 0);
if (av_channel_layout_compare(&outlink->ch_layout, &out_layout))
if (av_channel_layout_compare(&outlink->ch_layout, &inlink->ch_layout))
av_frame_side_data_remove(&outlink->side_data, &outlink->nb_side_data,
AV_FRAME_DATA_DOWNMIX_INFO);
}