linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ 1/2] avrcp: Fix error creating media items
Date: Wed, 12 Dec 2018 18:31:56 +0200	[thread overview]
Message-ID: <CABBYNZJ7o7TmZO+s8HQfvjK_YBB+hNXNPGuSqWxLU3GFK4DP8w@mail.gmail.com> (raw)
In-Reply-To: <20181206000033.14963-1-luiz.dentz@gmail.com>

Hi,
On Thu, Dec 6, 2018 at 2:00 AM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> Don't use item name in the object since it would need to be properly
> escaped if the remote stack uses UID 0, instead just create the path
> using the object pointer even  though it is invalid to have 0 as UID:
>
> AVRCP 1.6.1, page 84:
>
>   'The value of UID=0x0 is a special value used only to request
>    the metadata for the currently playing media using the
>    GetElementAttributes command and shall not be used for any item
>    in a folder.'
> ---
>  profiles/audio/player.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/profiles/audio/player.c b/profiles/audio/player.c
> index 048f98f96..ac23f720b 100644
> --- a/profiles/audio/player.c
> +++ b/profiles/audio/player.c
> @@ -1800,11 +1800,11 @@ static struct media_item *media_folder_create_item(struct media_player *mp,
>         item->player = mp;
>         item->uid = uid;
>
> -       if (uid > 0)
> +       if (!uid && name[0] == '/')
> +               item->path = g_strdup_printf("%s%s", mp->path, name);
> +       else
>                 item->path = g_strdup_printf("%s/item%" PRIu64 "",
>                                                 folder->item->path, uid);
> -       else
> -               item->path = g_strdup_printf("%s%s", mp->path, name);
>
>         item->name = g_strdup(name);
>         item->type = type;
> --
> 2.17.2

Applied.


-- 
Luiz Augusto von Dentz

      parent reply	other threads:[~2018-12-12 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06  0:00 [PATCH BlueZ 1/2] avrcp: Fix error creating media items Luiz Augusto von Dentz
2018-12-06  0:00 ` [PATCH BlueZ 2/2] gdbus: Make sure the object path and interface are valid Luiz Augusto von Dentz
2018-12-12 16:31 ` Luiz Augusto von Dentz [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=CABBYNZJ7o7TmZO+s8HQfvjK_YBB+hNXNPGuSqWxLU3GFK4DP8w@mail.gmail.com \
    --to=luiz.dentz@gmail.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;
as well as URLs for NNTP newsgroup(s).