audio/avrcp: Assing ids when registering a player 74/49874/2
authorBharat Panda <bharat.panda@samsung.com>
Wed, 21 Oct 2015 06:11:13 +0000 (11:41 +0530)
committerPyun DoHyun <dh79.pyun@samsung.com>
Thu, 22 Oct 2015 01:46:32 +0000 (18:46 -0700)
This gives the local player an id so when respoding to
GetFolderItem they are distinguishable.

Currently this required for further making a specific player ID
as addressed player.

git repo link:
http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=cde3bb8ab9336970036af9a7c8c2ea398c7ba626

Change-Id: I778a74e198a5f7d80187f73a6c36f948b73ddac3

profiles/audio/avrcp.c

index 40e4399..7ccd3dc 100644 (file)
@@ -3884,12 +3884,14 @@ struct avrcp_player *avrcp_register_player(struct btd_adapter *adapter,
        struct avrcp_server *server;
        struct avrcp_player *player;
        GSList *l;
+       static uint16_t id = 0;
 
        server = find_server(servers, adapter);
        if (!server)
                return NULL;
 
        player = g_new0(struct avrcp_player, 1);
+       player->id = ++id;
        player->server = server;
        player->cb = cb;
        player->user_data = user_data;