mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-13 01:05:42 +01:00
speaker-test: Show out-of-chmap channels as Unknown
Currently speaker-test falls back to ALSA default channel names for channels out-of-chmap. This causes e.g. the 4th channel of $ speaker-test -c4 -Dhdmi -m "FR,FL,FC" to be shown as "Rear Right". Change the code to show such channels as Unknown instead, similar to when snd_pcm_chmap_long_name() does not know the name. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
5b0c6da0d8
commit
58752c3ae3
1 changed files with 4 additions and 2 deletions
|
@ -267,8 +267,10 @@ static int get_speaker_channel(int chn)
|
||||||
static const char *get_channel_name(int chn)
|
static const char *get_channel_name(int chn)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPORT_CHMAP
|
#ifdef CONFIG_SUPPORT_CHMAP
|
||||||
if (channel_map && chn < channel_map->channels) {
|
if (channel_map) {
|
||||||
const char *name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
|
const char *name = NULL;
|
||||||
|
if (chn < channel_map->channels)
|
||||||
|
name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
|
||||||
return name ? name : "Unknown";
|
return name ? name : "Unknown";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue