All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] handsfree-audio: Fix parsing of Register() CODECs
@ 2013-04-12 22:25 =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  2013-04-12 23:18 ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita @ 2013-04-12 22:25 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

Without this patch the mSBC CODEC is always enabled, even when the
CODECs array in the Register() message from the agent contains only
entry for the CVSD (0x01) CODEC.
---
 src/handsfree-audio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 1a1cbff..3b0814f 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -682,9 +682,10 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
 		return __ofono_error_invalid_args(msg);
 
 	for (i = 0; i < length; i++) {
-		if (codecs[i] == HFP_CODEC_CVSD)
+		if (codecs[i] == HFP_CODEC_CVSD) {
 			has_cvsd = TRUE;
-		else if (codecs[i] != HFP_CODEC_MSBC)
+			continue;
+		} else if (codecs[i] != HFP_CODEC_MSBC)
 			return __ofono_error_invalid_args(msg);
 
 		if (defer_setup)
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] handsfree-audio: Fix parsing of Register() CODECs
  2013-04-12 22:25 [PATCH] handsfree-audio: Fix parsing of Register() CODECs =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
@ 2013-04-12 23:18 ` Denis Kenzior
  2013-04-13  0:06   ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2013-04-12 23:18 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

Hi João Paulo,

On 04/12/2013 05:25 PM, João Paulo Rechi Vita wrote:
> Without this patch the mSBC CODEC is always enabled, even when the
> CODECs array in the Register() message from the agent contains only
> entry for the CVSD (0x01) CODEC.
> ---
>   src/handsfree-audio.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
> index 1a1cbff..3b0814f 100644
> --- a/src/handsfree-audio.c
> +++ b/src/handsfree-audio.c
> @@ -682,9 +682,10 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
>   		return __ofono_error_invalid_args(msg);
>
>   	for (i = 0; i<  length; i++) {
> -		if (codecs[i] == HFP_CODEC_CVSD)
> +		if (codecs[i] == HFP_CODEC_CVSD) {
>   			has_cvsd = TRUE;
> -		else if (codecs[i] != HFP_CODEC_MSBC)
> +			continue;
> +		} else if (codecs[i] != HFP_CODEC_MSBC)
>   			return __ofono_error_invalid_args(msg);
>
>   		if (defer_setup)

Good catch.  I'd prefer we fix Patch 7 in Vinicius' series instead of 
applying this patch though.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] handsfree-audio: Fix parsing of Register() CODECs
  2013-04-12 23:18 ` Denis Kenzior
@ 2013-04-13  0:06   ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  2013-04-13  4:13     ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita @ 2013-04-13  0:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]

On Apr 12, 2013 8:18 PM, "Denis Kenzior" <denkenz@gmail.com> wrote:
>
> Hi João Paulo,
>
>
> On 04/12/2013 05:25 PM, João Paulo Rechi Vita wrote:
>>
>> Without this patch the mSBC CODEC is always enabled, even when the
>> CODECs array in the Register() message from the agent contains only
>> entry for the CVSD (0x01) CODEC.
>> ---
>>   src/handsfree-audio.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
>> index 1a1cbff..3b0814f 100644
>> --- a/src/handsfree-audio.c
>> +++ b/src/handsfree-audio.c
>> @@ -682,9 +682,10 @@ static DBusMessage
*am_agent_register(DBusConnection *conn,
>>                 return __ofono_error_invalid_args(msg);
>>
>>         for (i = 0; i<  length; i++) {
>> -               if (codecs[i] == HFP_CODEC_CVSD)
>> +               if (codecs[i] == HFP_CODEC_CVSD) {
>>                         has_cvsd = TRUE;
>> -               else if (codecs[i] != HFP_CODEC_MSBC)
>> +                       continue;
>> +               } else if (codecs[i] != HFP_CODEC_MSBC)
>>                         return __ofono_error_invalid_args(msg);
>>
>>                 if (defer_setup)
>
>
> Good catch.  I'd prefer we fix Patch 7 in Vinicius' series instead of
applying this patch though.
>

The bug fixed by this patch is not related to what patch 7 of Vinicius'
series does and it's present in the upstream master branch. I'm fine if you
prefer it stashed with Vinicius' patch, I'm just bringing up that the
patches do different things.

--
João Paulo Rechi Vita
http://about.me/jprvita

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2179 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] handsfree-audio: Fix parsing of Register() CODECs
  2013-04-13  0:06   ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
@ 2013-04-13  4:13     ` Denis Kenzior
  2013-04-15 13:16       ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2013-04-13  4:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

Hi João Paulo,

On 04/12/2013 07:06 PM, João Paulo Rechi Vita wrote:
>
> On Apr 12, 2013 8:18 PM, "Denis Kenzior" <denkenz@gmail.com
> <mailto:denkenz@gmail.com>> wrote:
>  >
>  > Hi João Paulo,
>  >
>  >
>  > On 04/12/2013 05:25 PM, João Paulo Rechi Vita wrote:
>  >>
>  >> Without this patch the mSBC CODEC is always enabled, even when the
>  >> CODECs array in the Register() message from the agent contains only
>  >> entry for the CVSD (0x01) CODEC.
>  >> ---
>  >>   src/handsfree-audio.c | 5 +++--
>  >>   1 file changed, 3 insertions(+), 2 deletions(-)
>  >>
>  >> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
>  >> index 1a1cbff..3b0814f 100644
>  >> --- a/src/handsfree-audio.c
>  >> +++ b/src/handsfree-audio.c
>  >> @@ -682,9 +682,10 @@ static DBusMessage
> *am_agent_register(DBusConnection *conn,
>  >>                 return __ofono_error_invalid_args(msg);
>  >>
>  >>         for (i = 0; i<  length; i++) {
>  >> -               if (codecs[i] == HFP_CODEC_CVSD)
>  >> +               if (codecs[i] == HFP_CODEC_CVSD) {
>  >>                         has_cvsd = TRUE;
>  >> -               else if (codecs[i] != HFP_CODEC_MSBC)
>  >> +                       continue;
>  >> +               } else if (codecs[i] != HFP_CODEC_MSBC)
>  >>                         return __ofono_error_invalid_args(msg);
>  >>
>  >>                 if (defer_setup)
>  >
>  >
>  > Good catch.  I'd prefer we fix Patch 7 in Vinicius' series instead of
> applying this patch though.
>  >
>
> The bug fixed by this patch is not related to what patch 7 of Vinicius'
> series does and it's present in the upstream master branch. I'm fine if
> you prefer it stashed with Vinicius' patch, I'm just bringing up that
> the patches do different things.

Are you sure?

Here's upstream:
         for (i = 0; i < length; i++) {
                 if (codecs[i] == HFP_CODEC_CVSD)
                         has_cvsd = TRUE;
                 else if (codecs[i] != HFP_CODEC_MSBC)
                         return __ofono_error_invalid_args(msg);
         }


I have a bad case of the flu, but that seems alright to me.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] handsfree-audio: Fix parsing of Register() CODECs
  2013-04-13  4:13     ` Denis Kenzior
@ 2013-04-15 13:16       ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  0 siblings, 0 replies; 5+ messages in thread
From: =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita @ 2013-04-15 13:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2431 bytes --]

On Sat, Apr 13, 2013 at 1:13 AM, Denis Kenzior <denkenz@gmail.com> wrote:
> Hi João Paulo,
>
>
> On 04/12/2013 07:06 PM, João Paulo Rechi Vita wrote:
>>
>>
>> On Apr 12, 2013 8:18 PM, "Denis Kenzior" <denkenz@gmail.com
>> <mailto:denkenz@gmail.com>> wrote:
>>  >
>>  > Hi João Paulo,
>>  >
>>  >
>>  > On 04/12/2013 05:25 PM, João Paulo Rechi Vita wrote:
>>  >>
>>  >> Without this patch the mSBC CODEC is always enabled, even when the
>>  >> CODECs array in the Register() message from the agent contains only
>>  >> entry for the CVSD (0x01) CODEC.
>>  >> ---
>>  >>   src/handsfree-audio.c | 5 +++--
>>  >>   1 file changed, 3 insertions(+), 2 deletions(-)
>>  >>
>>  >> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
>>  >> index 1a1cbff..3b0814f 100644
>>  >> --- a/src/handsfree-audio.c
>>  >> +++ b/src/handsfree-audio.c
>>  >> @@ -682,9 +682,10 @@ static DBusMessage
>> *am_agent_register(DBusConnection *conn,
>>  >>                 return __ofono_error_invalid_args(msg);
>>  >>
>>  >>         for (i = 0; i<  length; i++) {
>>  >> -               if (codecs[i] == HFP_CODEC_CVSD)
>>  >> +               if (codecs[i] == HFP_CODEC_CVSD) {
>>  >>                         has_cvsd = TRUE;
>>  >> -               else if (codecs[i] != HFP_CODEC_MSBC)
>>  >> +                       continue;
>>  >> +               } else if (codecs[i] != HFP_CODEC_MSBC)
>>  >>                         return __ofono_error_invalid_args(msg);
>>  >>
>>  >>                 if (defer_setup)
>>  >
>>  >
>>  > Good catch.  I'd prefer we fix Patch 7 in Vinicius' series instead of
>> applying this patch though.
>>  >
>>
>> The bug fixed by this patch is not related to what patch 7 of Vinicius'
>> series does and it's present in the upstream master branch. I'm fine if
>> you prefer it stashed with Vinicius' patch, I'm just bringing up that
>> the patches do different things.
>
>
> Are you sure?
>
> Here's upstream:
>
>         for (i = 0; i < length; i++) {
>                 if (codecs[i] == HFP_CODEC_CVSD)
>                         has_cvsd = TRUE;
>                 else if (codecs[i] != HFP_CODEC_MSBC)
>                         return __ofono_error_invalid_args(msg);
>         }
>
>
> I have a bad case of the flu, but that seems alright to me.
>

You're actually right, sorry for the noise.

--
João Paulo Rechi Vita
http://about.me/jprvita

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-15 13:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 22:25 [PATCH] handsfree-audio: Fix parsing of Register() CODECs =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
2013-04-12 23:18 ` Denis Kenzior
2013-04-13  0:06   ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
2013-04-13  4:13     ` Denis Kenzior
2013-04-15 13:16       ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.