[Xfce4-commits] <parole:master> Emit metadata only when chage playback state to playing.

matiasdelellis noreply at xfce.org
Thu Dec 12 00:18:04 CET 2013


Updating branch refs/heads/master
         to 232b540632a960fc753575a603604f3ef0bfbf3d (commit)
       from 3d28ecece50ca5127918c5d55d8138a0517a5fa1 (commit)

commit 232b540632a960fc753575a603604f3ef0bfbf3d
Author: matiasdelellis <mati86dl at hotmail.com>
Date:   Tue Nov 5 14:58:25 2013 -0300

    Emit metadata only when chage playback state to playing.

 src/plugins/mpris2/mpris2-provider.c |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/plugins/mpris2/mpris2-provider.c b/src/plugins/mpris2/mpris2-provider.c
index 9887dc4..e1bdd7c 100644
--- a/src/plugins/mpris2/mpris2-provider.c
+++ b/src/plugins/mpris2/mpris2-provider.c
@@ -576,17 +576,20 @@ static void parole_mpris_update_any (Mpris2Provider *provider)
         provider->volume = curr_vol;
         g_variant_builder_add (&b, "{sv}", "Volume", mpris_Player_get_Volume (NULL, provider));
     }
-    if(g_strcmp0(provider->saved_title, stream_uri))
+    if (parole_provider_player_get_state (player) == PAROLE_STATE_PLAYING)
     {
-        change_detected = TRUE;
-        if(provider->saved_title)
-        	g_free(provider->saved_title);
-        if (stream_uri && (stream_uri)[0])
-            provider->saved_title = stream_uri;
-        else
-            provider->saved_title = NULL;
-
-        g_variant_builder_add (&b, "{sv}", "Metadata", mpris_Player_get_Metadata (NULL, provider));
+        if(g_strcmp0(provider->saved_title, stream_uri))
+        {
+            change_detected = TRUE;
+            if(provider->saved_title)
+            	g_free(provider->saved_title);
+            if (stream_uri && (stream_uri)[0])
+                provider->saved_title = stream_uri;
+            else
+                provider->saved_title = NULL;
+
+            g_variant_builder_add (&b, "{sv}", "Metadata", mpris_Player_get_Metadata (NULL, provider));
+        }
     }
     if(change_detected)
     {


More information about the Xfce4-commits mailing list