[PATCH BlueZ 1/2] avrcp: Fix error creating media items

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux