summaryrefslogtreecommitdiffstats
path: root/src/alsa.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-26 03:33:13 +0200
committerLennart Poettering <lennart@poettering.net>2009-05-26 03:33:13 +0200
commit8d3f8a67a0fba847a9ef95fe93f2ca582067db8c (patch)
treed2917aefe10f77899cea2bdc3c2d457db921bbbb /src/alsa.c
parent65837e669bf8b02819f02db9d7d21a47babe1356 (diff)
alsa: disable multichannel support for alsa
Diffstat (limited to 'src/alsa.c')
-rw-r--r--src/alsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/alsa.c b/src/alsa.c
index 6629b34..5f35e8b 100644
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -233,6 +233,11 @@ static int open_alsa(ca_context *c, struct outstanding *out) {
ca_return_val_if_fail(c->private, CA_ERROR_STATE);
ca_return_val_if_fail(out, CA_ERROR_INVALID);
+ /* In ALSA we need to open different devices for doing
+ * multichannel audio. This cnnot be done in a backend-independant
+ * wa, hence we limit ourselves to mono/stereo only. */
+ ca_return_val_if_fail(ca_sound_file_get_nchannels(out->file) <= 2, CA_ERROR_NOTSUPPORTED);
+
p = PRIVATE(c);
if ((ret = snd_pcm_open(&out->pcm, c->device ? c->device : "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0)