From 8b62dc61549577667db3dad0fff02dd7f5f9b350 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 3 Jun 2014 16:00:56 +0300 Subject: [PATCH] audio/media: Check if setting value is already set If the setting value is already set the is no need to send anything. --- profiles/audio/media.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 2c7d0cbf1..fa5c01370 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1059,12 +1059,17 @@ static int set_setting(const char *key, const char *value, void *user_data) const char *iface = MEDIA_PLAYER_INTERFACE; DBusMessage *msg; DBusMessageIter iter; + const char *curval; DBG("%s = %s", key, value); - if (!g_hash_table_lookup(mp->settings, key)) + curval = g_hash_table_lookup(mp->settings, key); + if (!curval) return -EINVAL; + if (strcasecmp(curval, value) == 0) + return 0; + msg = dbus_message_new_method_call(mp->sender, mp->path, DBUS_INTERFACE_PROPERTIES, "Set"); if (msg == NULL) { -- 2.47.3