linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] player: Fix clearing track metadata
Date: Wed, 22 Nov 2017 14:36:45 +0100	[thread overview]
Message-ID: <1511357805.16347.43.camel@hadess.net> (raw)
In-Reply-To: <20171122133430.21672-1-luiz.dentz@gmail.com>

On Wed, 2017-11-22 at 15:34 +0200, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> The value stored in the hashtable is the path not the actual pointer
> of
> the item.
> ---
>  profiles/audio/player.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/profiles/audio/player.c b/profiles/audio/player.c
> index e499e6757..d12969bf9 100644
> --- a/profiles/audio/player.c
> +++ b/profiles/audio/player.c
> @@ -1885,6 +1885,7 @@ struct media_item
> *media_player_set_playlist_item(struct media_player *mp,
>  {
>  	struct media_folder *folder = mp->playlist;
>  	struct media_item *item;
> +	char *path;

const char *? So it's clear why you don't free it.

>  	DBG("%" PRIu64 "", uid);
>  
> @@ -1903,7 +1904,8 @@ struct media_item
> *media_player_set_playlist_item(struct media_player *mp,
>  		mp->track = g_hash_table_ref(item->metadata);
>  	}
>  
> -	if (item == g_hash_table_lookup(mp->track, "Item"))
> +	path = g_hash_table_lookup(mp->track, "Item");
> +	if (!g_strcmp0(path, item->path))
>  		return item;
>  
>  	if (mp->process_id == 0) {

  reply	other threads:[~2017-11-22 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 13:34 [PATCH BlueZ] player: Fix clearing track metadata Luiz Augusto von Dentz
2017-11-22 13:36 ` Bastien Nocera [this message]
2017-11-22 13:41   ` 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=1511357805.16347.43.camel@hadess.net \
    --to=hadess@hadess.net \
    --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 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).