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
Subject: [PATCH BlueZ 02/16] audio/AVRCP: Add browsed flag to player
Date: Fri, 14 Jun 2013 15:41:36 +0300	[thread overview]
Message-ID: <1371213710-16607-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1371213710-16607-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This flag indicates if the player is browsed and are checked to avoid
setting the same player as browsed multiple times.
---
 profiles/audio/avrcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 3d54fbe..90c80c3 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -182,6 +182,7 @@ struct avrcp_player {
 	GSList *sessions;
 	uint16_t id;
 	uint16_t uid_counter;
+	bool browsed;
 	uint8_t *features;
 
 	struct avrcp_player_cb *cb;
@@ -2095,6 +2096,7 @@ static gboolean avrcp_set_browsed_player_rsp(struct avctp *conn,
 		return FALSE;
 
 	player->uid_counter = bt_get_be16(&pdu->params[1]);
+	player->browsed = true;
 
 	items = bt_get_be32(&pdu->params[3]);
 
@@ -2444,7 +2446,7 @@ avrcp_parse_media_player_item(struct avrcp *session, uint8_t *operands,
 		media_player_set_name(mp, name);
 	}
 
-	if (session->player == player)
+	if (session->player == player && !player->browsed)
 		avrcp_set_browsed_player(session, player);
 
 	return player;
-- 
1.8.1.4


  parent reply	other threads:[~2013-06-14 12:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 12:41 [PATCH v3 BlueZ 00/16] MediaFolder and MediaItem implementation Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 01/16] audio/player: Split item creation Luiz Augusto von Dentz
2013-06-14 12:41 ` Luiz Augusto von Dentz [this message]
2013-06-14 12:41 ` [PATCH BlueZ 03/16] audio/AVRCP: Add support for GetFolderItems command Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 04/16] audio/player: Add implementation of MediaFolder.ListItems Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 05/16] audio/player: Add support for setting current Item object Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 06/16] audio/player: Add function media_item_set_playable Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 07/16] audio/player: Add support for MediaItem.Metadata property Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 08/16] audio/AVRCP: Add support for ChangePath command Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 09/16] audio/player: Add implementation of MediaFolder.ChangeFolder Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 10/16] audio/AVRCP: Add support for PlayItem command Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 11/16] audio/player: Add implementation of MediaItem.Play Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 12/16] audio/AVRCP: Add support for AddToNowPlaying command Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 13/16] audio/player: Add implementation of MediaItem.AddToNowPlaying Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 14/16] audio/AVRCP: Add support for Search command Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 15/16] audio/player: Add implementation of MediaFolder.Search Luiz Augusto von Dentz
2013-06-14 12:41 ` [PATCH BlueZ 16/16] audio/player: Create item on media_player_set_playlist_item Luiz Augusto von Dentz
2013-06-17 16:46 ` [PATCH v3 BlueZ 00/16] MediaFolder and MediaItem implementation 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=1371213710-16607-3-git-send-email-luiz.dentz@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).