Diff between 1908e388aa2ce3d17053de79749b1864c80d81af and 5d5d49e6396b4326e30f6cb5541dc322fb4b76fa

Changed Files

File Additions Deletions Status
profiles/audio/avrcp.c +2 -0 modified
profiles/audio/player.c +4 -1 modified

Full Patch

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index e20515d..51a89b1 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3137,6 +3137,8 @@ static int ct_play_item(struct media_player *mp, const char *name,
 
 	if (g_strrstr(name, "/NowPlaying"))
 		player->scope = 0x03;
+	else if (g_strrstr(name, "/Search"))
+		player->scope = 0x02;
 	else
 		player->scope = 0x01;
 
diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index f1bd9de..7944b49 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -1483,12 +1483,15 @@ static DBusMessage *media_item_play(DBusConnection *conn, DBusMessage *msg,
 	struct media_item *item = data;
 	struct media_player *mp = item->player;
 	struct player_callback *cb = mp->cb;
+	const char *path;
 	int err;
 
 	if (!item->playable || !cb->cbs->play_item)
 		return btd_error_not_supported(msg);
 
-	err = cb->cbs->play_item(mp, item->path, item->uid, cb->user_data);
+	path = mp->search && mp->scope == mp->search ? "/Search" : item->path;
+
+	err = cb->cbs->play_item(mp, path, item->uid, cb->user_data);
 	if (err < 0)
 		return btd_error_failed(msg, strerror(-err));