[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 01/01: MPRIS2: stale data retained after Metadata signal (Bug #14068)
noreply at xfce.org
noreply at xfce.org
Sat Feb 24 15:42:09 CET 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-pulseaudio-plugin.
commit 8fe88d6316ac2c1b3330c7804af0aa112ab50b19
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Feb 24 09:42:03 2018 -0500
MPRIS2: stale data retained after Metadata signal (Bug #14068)
---
panel-plugin/pulseaudio-mpris-player.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/panel-plugin/pulseaudio-mpris-player.c b/panel-plugin/pulseaudio-mpris-player.c
index 7e068c3..4a0f87b 100644
--- a/panel-plugin/pulseaudio-mpris-player.c
+++ b/panel-plugin/pulseaudio-mpris-player.c
@@ -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]);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list