audio/player: Fix media_player_set_metadata item destination
authorFrédéric Danis <frederic.danis@collabora.com>
Fri, 4 Oct 2024 14:40:41 +0000 (16:40 +0200)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 20 Feb 2025 07:43:23 +0000 (16:43 +0900)
Use item provided as parameter, or mp->track if NULL which is used
by MCP.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
profiles/audio/player.c

index dcf6ee1106f7ab113e966e7c4ca995c5d7495894..d0d2aacd9f276953a1a6bdfebbd6f57f6e0bd5d4 100755 (executable)
@@ -1567,6 +1567,7 @@ void media_player_set_metadata(struct media_player *mp,
 #else
        char *value, *curval;
 #endif
+       GHashTable *metadata = item ? item->metadata : mp->track;
 
        value = g_strndup(data, len);
 
@@ -1586,14 +1587,14 @@ void media_player_set_metadata(struct media_player *mp,
        DBG("%s: %s", key, value);
 
 #ifndef TIZEN_FEATURE_BLUEZ_MODIFY
-       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;
        }
 #endif
 
-       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)