Linux bluetooth development
 help / color / mirror / Atom feed
From: "Aurélien Zanelli" <aurelien.zanelli@parrot.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: "Aurélien Zanelli" <aurelien.zanelli@parrot.com>
Subject: [PATCH 1/2] sbc: fix frame length calculation for DUAL_CHANNEL mode
Date: Thu, 23 Oct 2014 16:32:20 +0200	[thread overview]
Message-ID: <1414074741-20286-2-git-send-email-aurelien.zanelli@parrot.com> (raw)
In-Reply-To: <1414074741-20286-1-git-send-email-aurelien.zanelli@parrot.com>

According to A2DP specification, section 12.9, for DUAL_CHANNEL mode, we
shall use the same formula as for MONO mode.
---
 sbc/sbc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbc/sbc.c b/sbc/sbc.c
index 534027e..e830388 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -1402,7 +1402,7 @@ SBC_EXPORT size_t sbc_get_frame_length(sbc_t *sbc)
 
 	ret = 4 + (4 * subbands * channels) / 8;
 	/* This term is not always evenly divide so we round it up */
-	if (channels == 1)
+	if (channels == 1 || sbc->mode == SBC_MODE_DUAL_CHANNEL)
 		ret += ((blocks * channels * bitpool) + 7) / 8;
 	else
 		ret += (((joint ? subbands : 0) + blocks * bitpool) + 7) / 8;
-- 
1.7.10.4


  reply	other threads:[~2014-10-23 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 14:32 [PATCH 0/2] sbc: fix frame length in DUAL_CHANNEL mode Aurélien Zanelli
2014-10-23 14:32 ` Aurélien Zanelli [this message]
2014-10-23 14:32 ` [PATCH 2/2] sbc: use an uint16 to store frame length in internal frame structure Aurélien Zanelli
2014-10-27 10:41 ` [PATCH 0/2] sbc: fix frame length in DUAL_CHANNEL mode Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414074741-20286-2-git-send-email-aurelien.zanelli@parrot.com \
    --to=aurelien.zanelli@parrot.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox