Diff between a40b1d1a0f10e0b6d42018a84bbf1a43b40e21f5 and ff065d5d6ee425717222c30b7cc38c462e7cc380

Changed Files

File Additions Deletions Status
profiles/audio/avrcp.c +8 -1 modified
profiles/audio/player.c +11 -0 modified
profiles/audio/player.h +1 -0 modified

Full Patch

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 539684d..d46e598 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2096,6 +2096,7 @@ static struct media_item *parse_media_element(struct avrcp *session,
 {
 	struct avrcp_player *player;
 	struct media_player *mp;
+	struct media_item *item;
 	uint16_t namelen;
 	char name[255];
 	uint64_t uid;
@@ -2114,7 +2115,13 @@ static struct media_item *parse_media_element(struct avrcp *session,
 	player = session->player;
 	mp = player->user_data;
 
-	return media_player_create_item(mp, name, PLAYER_ITEM_TYPE_AUDIO, uid);
+	item = media_player_create_item(mp, name, PLAYER_ITEM_TYPE_AUDIO, uid);
+	if (item == NULL)
+		return NULL;
+
+	media_item_set_playable(item, true);
+
+	return item;
 }
 
 static struct media_item *parse_media_folder(struct avrcp *session,
diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index c151560..69e8cd5 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -1466,6 +1466,17 @@ static const GDBusPropertyTable media_item_properties[] = {
 	{ }
 };
 
+void media_item_set_playable(struct media_item *item, bool value)
+{
+	if (item->playable == value)
+		return;
+
+	item->playable = value;
+
+	g_dbus_emit_property_changed(btd_get_dbus_connection(), item->path,
+					MEDIA_ITEM_INTERFACE, "Playable");
+}
+
 struct media_item *media_player_create_item(struct media_player *mp,
 						const char *name,
 						player_item_type_t type,
diff --git a/profiles/audio/player.h b/profiles/audio/player.h
index 3a388d2..20de0b8 100644
--- a/profiles/audio/player.h
+++ b/profiles/audio/player.h
@@ -88,6 +88,7 @@ struct media_item *media_player_create_item(struct media_player *mp,
 						player_item_type_t type,
 						uint64_t uid);
 
+void media_item_set_playable(struct media_item *item, bool value);
 void media_player_list_complete(struct media_player *mp, GSList *items,
 								int err);