Skip to content
Snippets Groups Projects
Commit 8fe88d63 authored by Sean Davis's avatar Sean Davis
Browse files

MPRIS2: stale data retained after Metadata signal (Bug #14068)

parent 77e1080b
No related branches found
No related tags found
No related merge requests found
......@@ -149,13 +149,23 @@ pulseaudio_mpris_player_parse_metadata (PulseaudioMprisPlayer *player,
gchar **artists;
if (player->title != NULL)
{
g_free(player->title);
player->title = NULL;
}
if (player->artist != NULL)
{
g_free(player->artist);
player->artist = NULL;
}
g_variant_iter_init (&iter, dictionary);
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
{
if (0 == g_ascii_strcasecmp (key, "xesam:title"))
{
if (player->title != NULL)
g_free (player->title);
player->title = g_strdup(g_variant_get_string(value, NULL));
}
else if (0 == g_ascii_strcasecmp (key, "xesam:artist"))
......@@ -163,9 +173,6 @@ pulseaudio_mpris_player_parse_metadata (PulseaudioMprisPlayer *player,
artists = g_variant_dup_strv (value, NULL);
if (artists != NULL)
{
if (player->artist != NULL)
g_free(player->artist);
if (g_strv_length (artists) > 0)
{
player->artist = g_strdup (artists[0]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment