summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-03 13:37:46 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-03 13:37:46 +0000
commitf7ca86c9aa904a915af6720a0add59dd6148cca1 (patch)
treef0259a9095b019443cf0dc5a7486543b1b97f01b /audio/unix.c
parent6bcb8c0cf5eb1842cc7d04ca34497869547ebefe (diff)
Fix channel mode bug.
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/audio/unix.c b/audio/unix.c
index 2cb0d804..c39c80c4 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -347,9 +347,23 @@ static void a2dp_setup_complete(struct avdtp *session, struct a2dp_sep *sep,
cfg->fd_opt = CFG_FD_OPT_WRITE;
sbc_cap = (void *) codec_cap;
- cfg->mode = sbc_cap->channel_mode;
cfg->sample_size = 2;
+ switch (sbc_cap->channel_mode) {
+ case A2DP_CHANNEL_MODE_MONO:
+ cfg->mode = CFG_MODE_MONO;
+ break;
+ case A2DP_CHANNEL_MODE_DUAL_CHANNEL:
+ cfg->mode = CFG_MODE_DUAL_CHANNEL;
+ break;
+ case A2DP_CHANNEL_MODE_STEREO:
+ cfg->mode = CFG_MODE_STEREO;
+ break;
+ case A2DP_CHANNEL_MODE_JOINT_STEREO:
+ cfg->mode = CFG_MODE_JOINT_STEREO;
+ break;
+ }
+
switch (sbc_cap->frequency) {
case A2DP_SAMPLING_FREQ_16000:
cfg->rate = 16000;