All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang-Huang Bao <eh5@sokka.cn>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ v3] avrcp: Fix unregister AVRCP player
Date: Sat, 22 May 2021 08:29:33 +0800	[thread overview]
Message-ID: <b2de7e62-1360-c443-fdd3-929dc990696f@sokka.cn> (raw)
In-Reply-To: <CABBYNZK0tmCaAKjLS3s-yndRnmsQsaurOnx7-ffa_QyQ_7BgYQ@mail.gmail.com>

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.
>

      reply	other threads:[~2021-05-22  0:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=b2de7e62-1360-c443-fdd3-929dc990696f@sokka.cn \
    --to=eh5@sokka.cn \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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 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.