diff mbox series

[FFmpeg-devel,2/6] avfilter/af_channelmap: fix mapping if in_channel was a string but out_channel was not specified

Message ID 20240319211504.8342-2-cus@passwd.hu
State Accepted
Commit 1bea3e9ee2f3521182eea6066fc8e8e1f8910c5b
Headers show
Series [FFmpeg-devel,1/6] avfilter/af_channelmap: fix error message if FL source channel was missing | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marton Balint March 19, 2024, 9:15 p.m. UTC
In this case in_channel_idx was never set and the default 0 was used.
Suprisingly no one noticed that the respective fate test output was wrong.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/af_channelmap.c | 2 +-
 tests/fate/filter-audio.mak | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol March 23, 2024, 12:26 p.m. UTC | #1
Please add coverage for regression cases in FATE.
diff mbox series

Patch

diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index d13dcc317d..35dc4c4618 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -342,7 +342,7 @@  static int channelmap_config_input(AVFilterLink *inlink)
     for (i = 0; i < s->nch; i++) {
         struct ChannelMap *m = &s->map[i];
 
-        if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
+        if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR || s->mode == MAP_ONE_STR) {
             m->in_channel_idx = av_channel_layout_index_from_channel(
                 &inlink->ch_layout, m->in_channel);
         }
diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 308969c4ac..88299a932f 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -302,7 +302,7 @@  fate-filter-channelmap-one-str: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.w
 fate-filter-channelmap-one-str: tests/data/asynth-44100-2.wav
 fate-filter-channelmap-one-str: CMD = md5 -auto_conversion_filters -i $(SRC) -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/channelmap_one_str -f wav -fflags +bitexact
 fate-filter-channelmap-one-str: CMP = oneline
-fate-filter-channelmap-one-str: REF = 0ea3052e482c95d5d3bd9da6dac1b5fa
+fate-filter-channelmap-one-str: REF = e18791f65ce5861e130b2c3e472ab90a
 
 FATE_AFILTER-$(call FILTERDEMDECENCMUX, CHANNELMAP ARESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_FILTER_CHANNELMAP)