audio/player: Fix not setting scope properly
If file is played from search folder it shall use search scope not vfs.
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 @@
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 @@
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));