diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-09-03 13:37:46 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-09-03 13:37:46 +0000 |
commit | f7ca86c9aa904a915af6720a0add59dd6148cca1 (patch) | |
tree | f0259a9095b019443cf0dc5a7486543b1b97f01b | |
parent | 6bcb8c0cf5eb1842cc7d04ca34497869547ebefe (diff) |
Fix channel mode bug.
-rw-r--r-- | audio/unix.c | 16 |
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; |