From: Sangchul Lee Date: Tue, 16 Mar 2021 05:36:54 +0000 (+0900) Subject: stream-manager-dbus: Update mute vconf only after internal set is successful X-Git-Tag: submit/tizen/20210318.035923~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d45adaee6ea5b878f97d93759d6715b4b93e1589;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git stream-manager-dbus: Update mute vconf only after internal set is successful [Version] 13.0.50 [Issue Type] Bug fix Change-Id: Id58f2d54e5a88c583f87ab2ecaa56823b36fd8b3 Signed-off-by: Sangchul Lee --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index 06a0216..351047c 100644 --- a/packaging/pulseaudio-modules-tizen.spec +++ b/packaging/pulseaudio-modules-tizen.spec @@ -1,6 +1,6 @@ Name: pulseaudio-modules-tizen Summary: Pulseaudio modules for Tizen -Version: 13.0.49 +Version: 13.0.50 Release: 0 Group: Multimedia/Audio License: LGPL-2.1+ diff --git a/src/stream-manager-dbus.c b/src/stream-manager-dbus.c index 80ec2c1..2f6e4c6 100644 --- a/src/stream-manager-dbus.c +++ b/src/stream-manager-dbus.c @@ -1321,6 +1321,7 @@ static void handle_set_volume_mute(DBusConnection *conn, DBusMessage *msg, void const char *direction = NULL; const char *type = NULL; dbus_uint32_t do_mute = 0; + bool old_mute = false; stream_type_t stream_type = STREAM_SINK_INPUT; ret_msg_t ret = RET_MSG_OK; @@ -1340,14 +1341,21 @@ static void handle_set_volume_mute(DBusConnection *conn, DBusMessage *msg, void goto finish; } - /* check vconf update here, mute will not be set if update fails */ - if (update_mute_vconf(type, do_mute) != 0) { + if (get_volume_mute_by_type(m, stream_type, type, &old_mute) != 0) { ret = RET_MSG_ERROR_INTERNAL; goto finish; } - if (set_volume_mute_by_type(m, stream_type, type, (bool)do_mute) != 0) + if (set_volume_mute_by_type(m, stream_type, type, (bool)do_mute) != 0) { ret = RET_MSG_ERROR_INTERNAL; + goto finish; + } + + if (update_mute_vconf(type, do_mute) != 0) { + ret = RET_MSG_ERROR_INTERNAL; + pa_log_error("Failed to update mute vconf, rollback to old mute[%u]", old_mute); + set_volume_mute_by_type(m, stream_type, type, old_mute); + } finish: pa_dbus_send_basic_value_reply(conn, msg, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[ret]);