summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/polyp/channelmap.c36
-rw-r--r--src/polyp/channelmap.h5
2 files changed, 27 insertions, 14 deletions
diff --git a/src/polyp/channelmap.c b/src/polyp/channelmap.c
index 7bfd21e6..bb47deb8 100644
--- a/src/polyp/channelmap.c
+++ b/src/polyp/channelmap.c
@@ -71,34 +71,46 @@ pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels) {
pa_channel_map_init(m);
m->channels = channels;
+
+ /* This is somewhat compatible with RFC3551 */
switch (channels) {
case 1:
m->map[0] = PA_CHANNEL_POSITION_MONO;
return m;
- case 8:
- m->map[6] = PA_CHANNEL_POSITION_SIDE_LEFT;
- m->map[7] = PA_CHANNEL_POSITION_SIDE_RIGHT;
- /* Fall through */
-
case 6:
+ m->map[0] = PA_CHANNEL_POSITION_FRONT_LEFT;
+ m->map[1] = PA_CHANNEL_POSITION_SIDE_LEFT;
+ m->map[2] = PA_CHANNEL_POSITION_FRONT_CENTER;
+ m->map[3] = PA_CHANNEL_POSITION_FRONT_RIGHT;
+ m->map[4] = PA_CHANNEL_POSITION_SIDE_RIGHT;
m->map[5] = PA_CHANNEL_POSITION_LFE;
- /* Fall through */
+ return m;
case 5:
- m->map[4] = PA_CHANNEL_POSITION_FRONT_CENTER;
- /* Fall through */
-
- case 4:
- m->map[2] = PA_CHANNEL_POSITION_REAR_LEFT;
- m->map[3] = PA_CHANNEL_POSITION_REAR_RIGHT;
+ m->map[2] = PA_CHANNEL_POSITION_FRONT_CENTER;
+ m->map[3] = PA_CHANNEL_POSITION_REAR_LEFT;
+ m->map[4] = PA_CHANNEL_POSITION_REAR_RIGHT;
/* Fall through */
case 2:
m->map[0] = PA_CHANNEL_POSITION_FRONT_LEFT;
m->map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT;
return m;
+
+ case 3:
+ m->map[0] = PA_CHANNEL_POSITION_LEFT;
+ m->map[1] = PA_CHANNEL_POSITION_RIGHT;
+ m->map[2] = PA_CHANNEL_POSITION_CENTER;
+ return m;
+
+ case 4:
+ m->map[0] = PA_CHANNEL_POSITION_LEFT;
+ m->map[1] = PA_CHANNEL_POSITION_CENTER;
+ m->map[2] = PA_CHANNEL_POSITION_RIGHT;
+ m->map[3] = PA_CHANNEL_POSITION_LFE;
+ return m;
default:
return NULL;
diff --git a/src/polyp/channelmap.h b/src/polyp/channelmap.h
index 0b9f6e26..7c48b76b 100644
--- a/src/polyp/channelmap.h
+++ b/src/polyp/channelmap.h
@@ -36,10 +36,11 @@ typedef enum {
PA_CHANNEL_POSITION_LEFT,
PA_CHANNEL_POSITION_RIGHT,
-
- PA_CHANNEL_POSITION_FRONT_CENTER,
+ PA_CHANNEL_POSITION_CENTER,
+
PA_CHANNEL_POSITION_FRONT_LEFT = PA_CHANNEL_POSITION_LEFT,
PA_CHANNEL_POSITION_FRONT_RIGHT = PA_CHANNEL_POSITION_RIGHT,
+ PA_CHANNEL_POSITION_FRONT_CENTER = PA_CHANNEL_POSITION_CENTER,
PA_CHANNEL_POSITION_REAR_CENTER,
PA_CHANNEL_POSITION_REAR_LEFT,