summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-constants.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2015-09-26 16:59:13 +0200
committerMichal Ratajsky <[email protected]>2015-09-26 16:59:13 +0200
commit10a0b2193303063167a297f542c4de0952a4cd25 (patch)
treebb79ff0560091dc4620d31b90f4d476939fd3ed4 /backends/alsa/alsa-constants.c
parent06b3b936980f2b12aabf4aff64230c86e81e8cff (diff)
downloadlibmatemixer-10a0b2193303063167a297f542c4de0952a4cd25.tar.bz2
libmatemixer-10a0b2193303063167a297f542c4de0952a4cd25.tar.xz
alsa: Fix FTBFS with old versions of ALSA (fixes #4)
Diffstat (limited to 'backends/alsa/alsa-constants.c')
-rw-r--r--backends/alsa/alsa-constants.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/backends/alsa/alsa-constants.c b/backends/alsa/alsa-constants.c
index 853db95..c55fc6e 100644
--- a/backends/alsa/alsa-constants.c
+++ b/backends/alsa/alsa-constants.c
@@ -20,6 +20,7 @@
#include <alsa/asoundlib.h>
#include <libmatemixer/matemixer.h>
+#include "alsa-compat.h"
#include "alsa-constants.h"
/*
@@ -228,9 +229,11 @@ const MateMixerChannelPosition alsa_channel_map_from[SND_MIXER_SCHN_LAST] =
[SND_MIXER_SCHN_REAR_RIGHT] = MATE_MIXER_CHANNEL_BACK_RIGHT,
[SND_MIXER_SCHN_FRONT_CENTER] = MATE_MIXER_CHANNEL_FRONT_CENTER,
[SND_MIXER_SCHN_WOOFER] = MATE_MIXER_CHANNEL_LFE,
+#if SND_LIB_VERSION >= ALSA_PACK_VERSION (1, 0, 10)
[SND_MIXER_SCHN_SIDE_LEFT] = MATE_MIXER_CHANNEL_SIDE_LEFT,
[SND_MIXER_SCHN_SIDE_RIGHT] = MATE_MIXER_CHANNEL_SIDE_RIGHT,
[SND_MIXER_SCHN_REAR_CENTER] = MATE_MIXER_CHANNEL_BACK_CENTER
+#endif
};
const snd_mixer_selem_channel_id_t alsa_channel_map_to[MATE_MIXER_CHANNEL_MAX] =
@@ -243,11 +246,17 @@ const snd_mixer_selem_channel_id_t alsa_channel_map_to[MATE_MIXER_CHANNEL_MAX] =
[MATE_MIXER_CHANNEL_LFE] = SND_MIXER_SCHN_WOOFER,
[MATE_MIXER_CHANNEL_BACK_LEFT] = SND_MIXER_SCHN_REAR_LEFT,
[MATE_MIXER_CHANNEL_BACK_RIGHT] = SND_MIXER_SCHN_REAR_RIGHT,
+#if SND_LIB_VERSION >= ALSA_PACK_VERSION (1, 0, 10)
[MATE_MIXER_CHANNEL_BACK_CENTER] = SND_MIXER_SCHN_REAR_CENTER,
- [MATE_MIXER_CHANNEL_FRONT_LEFT_CENTER] = SND_MIXER_SCHN_UNKNOWN,
- [MATE_MIXER_CHANNEL_FRONT_RIGHT_CENTER] = SND_MIXER_SCHN_UNKNOWN,
[MATE_MIXER_CHANNEL_SIDE_LEFT] = SND_MIXER_SCHN_SIDE_LEFT,
[MATE_MIXER_CHANNEL_SIDE_RIGHT] = SND_MIXER_SCHN_SIDE_RIGHT,
+#else
+ [MATE_MIXER_CHANNEL_BACK_CENTER] = SND_MIXER_SCHN_UNKNOWN,
+ [MATE_MIXER_CHANNEL_SIDE_LEFT] = SND_MIXER_SCHN_UNKNOWN,
+ [MATE_MIXER_CHANNEL_SIDE_RIGHT] = SND_MIXER_SCHN_UNKNOWN,
+#endif
+ [MATE_MIXER_CHANNEL_FRONT_LEFT_CENTER] = SND_MIXER_SCHN_UNKNOWN,
+ [MATE_MIXER_CHANNEL_FRONT_RIGHT_CENTER] = SND_MIXER_SCHN_UNKNOWN,
[MATE_MIXER_CHANNEL_TOP_FRONT_LEFT] = SND_MIXER_SCHN_UNKNOWN,
[MATE_MIXER_CHANNEL_TOP_FRONT_RIGHT] = SND_MIXER_SCHN_UNKNOWN,
[MATE_MIXER_CHANNEL_TOP_FRONT_CENTER] = SND_MIXER_SCHN_UNKNOWN,