All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player
@ 2021-05-20  9:22 Huang-Huang Bao
  2021-05-22  0:25 ` Huang-Huang Bao
  2021-05-22  0:25 ` Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Huang-Huang Bao @ 2021-05-20  9:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Huang-Huang Bao

'notify_addressed_player_changed()' expected to be called with
'player->changed_id' set to a non-zero value.

    player->changed_id = g_idle_add(notify_addressed_player_changed,
                                    player);

And 'avrcp_player_event()' relies on 'player->changed_id' to perform
Addressed Player Changed notification. However,
'avrcp_unregister_player()' calls 'notify_addressed_player_changed()'
without adding it to the main loop and set 'player->changed_id'. To
indicate addreddsed player changed for both scenarios, we set
'player->changed_id' to 1 at the head of
'notify_addressed_player_changed()'.

Fixes https://github.com/bluez/bluez/issues/142
---
 profiles/audio/avrcp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 58d30b24d..ef721e17b 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1794,6 +1794,12 @@ static gboolean notify_addressed_player_changed(gpointer user_data)
 				};
 	uint8_t i;

+	/*
+	 * Set changed_id to an non-zero value to indicate addreddsed player
+	 * changed.
+	 */
+	player->changed_id = 1;
+
 	avrcp_player_event(player, AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED, NULL);

 	/*
--
2.31.1

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

* Re: [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player
  2021-05-20  9:22 [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player Huang-Huang Bao
@ 2021-05-22  0:25 ` Huang-Huang Bao
  2021-05-22  0:25 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 4+ messages in thread
From: Huang-Huang Bao @ 2021-05-22  0:25 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

Seems the test bot failed to send mail, but all tests for this patch did 
passed though, see 
https://github.com/BluezTestBot/bluez/pull/824/checks?check_run_id=2628653346.

Should I resend the patch to make test bot re-run the tests and resend 
result mail?

Regards,
Bao

On 5/20/21 5:22 PM, Huang-Huang Bao wrote:
> 'notify_addressed_player_changed()' expected to be called with
> 'player->changed_id' set to a non-zero value.
> 
>      player->changed_id = g_idle_add(notify_addressed_player_changed,
>                                      player);
> 
> And 'avrcp_player_event()' relies on 'player->changed_id' to perform
> Addressed Player Changed notification. However,
> 'avrcp_unregister_player()' calls 'notify_addressed_player_changed()'
> without adding it to the main loop and set 'player->changed_id'. To
> indicate addreddsed player changed for both scenarios, we set
> 'player->changed_id' to 1 at the head of
> 'notify_addressed_player_changed()'.
> 
> Fixes https://github.com/bluez/bluez/issues/142
> ---
>   profiles/audio/avrcp.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index 58d30b24d..ef721e17b 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -1794,6 +1794,12 @@ static gboolean notify_addressed_player_changed(gpointer user_data)
>   				};
>   	uint8_t i;
> 
> +	/*
> +	 * Set changed_id to an non-zero value to indicate addreddsed player
> +	 * changed.
> +	 */
> +	player->changed_id = 1;
> +
>   	avrcp_player_event(player, AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED, NULL);
> 
>   	/*
> --
> 2.31.1
> 

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

* Re: [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player
  2021-05-20  9:22 [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player Huang-Huang Bao
  2021-05-22  0:25 ` Huang-Huang Bao
@ 2021-05-22  0:25 ` Luiz Augusto von Dentz
  2021-05-22  0:29   ` Huang-Huang Bao
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2021-05-22  0:25 UTC (permalink / raw)
  To: Huang-Huang Bao; +Cc: linux-bluetooth

Hi Huang-Huang,

On Thu, May 20, 2021 at 7:44 AM Huang-Huang Bao <eh5@sokka.cn> wrote:
>
> 'notify_addressed_player_changed()' expected to be called with
> 'player->changed_id' set to a non-zero value.
>
>     player->changed_id = g_idle_add(notify_addressed_player_changed,
>                                     player);
>
> And 'avrcp_player_event()' relies on 'player->changed_id' to perform
> Addressed Player Changed notification. However,
> 'avrcp_unregister_player()' calls 'notify_addressed_player_changed()'
> without adding it to the main loop and set 'player->changed_id'. To
> indicate addreddsed player changed for both scenarios, we set
> 'player->changed_id' to 1 at the head of
> 'notify_addressed_player_changed()'.
>
> Fixes https://github.com/bluez/bluez/issues/142
> ---
>  profiles/audio/avrcp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index 58d30b24d..ef721e17b 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -1794,6 +1794,12 @@ static gboolean notify_addressed_player_changed(gpointer user_data)
>                                 };
>         uint8_t i;
>
> +       /*
> +        * Set changed_id to an non-zero value to indicate addreddsed player
> +        * changed.
> +        */
> +       player->changed_id = 1;
> +
>         avrcp_player_event(player, AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED, NULL);
>
>         /*
> --
> 2.31.1

Applied, thanks.

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player
  2021-05-22  0:25 ` Luiz Augusto von Dentz
@ 2021-05-22  0:29   ` Huang-Huang Bao
  0 siblings, 0 replies; 4+ messages in thread
From: Huang-Huang Bao @ 2021-05-22  0:29 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi, Luiz

Oh, what a timing, thanks!

On 5/22/21 8:25 AM, Luiz Augusto von Dentz wrote:
> Hi Huang-Huang,
>
> On Thu, May 20, 2021 at 7:44 AM Huang-Huang Bao <eh5@sokka.cn> wrote:
>> 'notify_addressed_player_changed()' expected to be called with
>> 'player->changed_id' set to a non-zero value.
>>
>>      player->changed_id = g_idle_add(notify_addressed_player_changed,
>>                                      player);
>>
>> And 'avrcp_player_event()' relies on 'player->changed_id' to perform
>> Addressed Player Changed notification. However,
>> 'avrcp_unregister_player()' calls 'notify_addressed_player_changed()'
>> without adding it to the main loop and set 'player->changed_id'. To
>> indicate addreddsed player changed for both scenarios, we set
>> 'player->changed_id' to 1 at the head of
>> 'notify_addressed_player_changed()'.
>>
>> Fixes https://github.com/bluez/bluez/issues/142
>> ---
>>   profiles/audio/avrcp.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
>> index 58d30b24d..ef721e17b 100644
>> --- a/profiles/audio/avrcp.c
>> +++ b/profiles/audio/avrcp.c
>> @@ -1794,6 +1794,12 @@ static gboolean notify_addressed_player_changed(gpointer user_data)
>>                                  };
>>          uint8_t i;
>>
>> +       /*
>> +        * Set changed_id to an non-zero value to indicate addreddsed player
>> +        * changed.
>> +        */
>> +       player->changed_id = 1;
>> +
>>          avrcp_player_event(player, AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED, NULL);
>>
>>          /*
>> --
>> 2.31.1
> Applied, thanks.
>

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

end of thread, other threads:[~2021-05-22  0:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  9:22 [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player Huang-Huang Bao
2021-05-22  0:25 ` Huang-Huang Bao
2021-05-22  0:25 ` Luiz Augusto von Dentz
2021-05-22  0:29   ` Huang-Huang Bao

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.