mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-09-20 01:59:57 +02:00
speaker-test: Fix wrong wave file played back in chmap setup
When explicitly specifying channel maps, we need to use that when loading wave files so the correct file is played back. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
9fe90a020c
commit
7ac9508c4e
1 changed files with 11 additions and 3 deletions
|
@ -771,7 +771,15 @@ static int setup_wav_file(int chn)
|
||||||
|
|
||||||
if (given_test_wav_file)
|
if (given_test_wav_file)
|
||||||
return check_wav_file(chn, given_test_wav_file);
|
return check_wav_file(chn, given_test_wav_file);
|
||||||
else
|
|
||||||
|
#ifdef CONFIG_SUPPORT_CHMAP
|
||||||
|
if (channel_map_set && chn < channel_map->channels) {
|
||||||
|
int channel = channel_map->pos[chn] - SND_CHMAP_FL;
|
||||||
|
if (channel >= 0 && channel < MAX_CHANNELS)
|
||||||
|
return check_wav_file(chn, wavs[channel]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return check_wav_file(chn, wavs[chn]);
|
return check_wav_file(chn, wavs[chn]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1179,7 +1187,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
if (test_type == TEST_WAV) {
|
if (test_type == TEST_WAV) {
|
||||||
for (chn = 0; chn < channels; chn++) {
|
for (chn = 0; chn < channels; chn++) {
|
||||||
if (setup_wav_file(chn) < 0)
|
if (setup_wav_file(get_speaker_channel(chn)) < 0)
|
||||||
prg_exit(EXIT_FAILURE);
|
prg_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue