[Spice-devel] [spice-server] sound: do not change volume or mute state on migration
Victor Toso
victortoso at redhat.com
Thu Nov 16 15:17:01 UTC 2017
From: Victor Toso <me at victortoso.com>
On migration, we are resending the current volume and mute state in
the Guest. If the client user has change its master volume in the
guest it might change the client application volume too and the volume
jump (increase or decrease) might happen on migration.
This patch is a complement of f10de4bc084fcc - Here, volume was
jumping regardless of guest's volume value.
Resolves: rhbz#1425443
Signed-off-by: Victor Toso <victortoso at redhat.com>
---
server/sound.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/server/sound.c b/server/sound.c
index b1bfaaaa..c6c8bdc8 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -414,6 +414,12 @@ static bool snd_send_volume(SndChannelClient *client, uint32_t cap, int msg)
return false;
}
+ /* Never changes volume or mute state on migration */
+ if (red_client_during_migrate_at_target(red_channel_client_get_client(rcc))) {
+ spice_debug("Do not change volume during migration");
+ return FALSE;
+ }
+
vol = alloca(sizeof (SpiceMsgAudioVolume) +
st->volume_nchannels * sizeof (uint16_t));
red_channel_client_init_send_data(rcc, msg);
@@ -445,6 +451,12 @@ static bool snd_send_mute(SndChannelClient *client, uint32_t cap, int msg)
return false;
}
+ /* Never changes volume or mute state on migration */
+ if (red_client_during_migrate_at_target(red_channel_client_get_client(rcc))) {
+ spice_debug("Do not change mute during migration");
+ return FALSE;
+ }
+
red_channel_client_init_send_data(rcc, msg);
mute.mute = st->mute;
spice_marshall_SpiceMsgAudioMute(m, &mute);
--
2.15.0
More information about the Spice-devel
mailing list