Follow channel position definitions to mixer channel in mixer.h

mixer.h already contains some channel position definitions.
To be more consistent over all systems, better to follow the same
order for the new channel map, too.  But since UNKNOWN channel must be
zero but the definition in mixer.h contains -1 as UNKNOWN, simply
shift the value with 1.

If the conversion is required between SND_CHMAP and SND_MIXER_SCHN,
just increment/decrement 1.  Eventually I'll provide helper functions
for that...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2012-08-21 15:07:44 +02:00
parent 915b26bfe8
commit 0f36270dd3
3 changed files with 20 additions and 21 deletions

View file

@ -23,12 +23,9 @@ static void usage(void)
static const char * const chname[] = {
"Unknown",
"FL", "FC", "FR",
"FLC", "FRC", "RL", "RC", "RR",
"RLC", "RRC", "SL", "SR", "LFE",
"FLW", "FRW", "FLH",
"FCH", "FCH", "FRH",
"TC"
"FL", "FR", "RL", "RR", "FC", "LFE", "SL", "SR", "RC",
"FLC", "FRC", "RLC", "RRC", "FLW", "FRW", "FLH",
"FCH", "FCH", "FRH", "TC"
};
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
@ -56,7 +53,7 @@ static int to_channel(const char *name)
for (i = 0; i < ARRAY_SIZE(chname); i++)
if (!strcmp(chname[i], name))
return i;
return 0;
return SND_CHMAP_UNKNOWN;
}
static const char *chmap_type(int type)