[PATCH BlueZ 1/3] audio/player: Fix media_player_set_metadata item destination

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

 



Use item provided as parameter, or mp->track if NULL which is used
by MCP.
---
 profiles/audio/player.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index b3a6920fc..5bb3bc1a9 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -1438,18 +1438,19 @@ void media_player_set_metadata(struct media_player *mp,
 				void *data, size_t len)
 {
 	char *value, *curval;
+	GHashTable *metadata = item ? item->metadata : mp->track;
 
 	value = g_strndup(data, len);
 
 	DBG("%s: %s", key, value);
 
-	curval = g_hash_table_lookup(mp->track, key);
+	curval = g_hash_table_lookup(metadata, key);
 	if (g_strcmp0(curval, value) == 0) {
 		g_free(value);
 		return;
 	}
 
-	g_hash_table_replace(mp->track, g_strdup(key), value);
+	g_hash_table_replace(metadata, g_strdup(key), value);
 }
 
 void media_player_metadata_changed(struct media_player *mp)
-- 
2.34.1





[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