[Spice-commits] gtk/channel-playback.c gtk/channel-record.c
Hans de Goede
jwrdegoede at kemper.freedesktop.org
Wed Apr 3 00:43:11 PDT 2013
gtk/channel-playback.c | 5 +++++
gtk/channel-record.c | 5 +++++
2 files changed, 10 insertions(+)
New commits:
commit a0cadd9a56e051388e78a3dff3f25cf8c78dd86c
Author: Hans de Goede <hdegoede at redhat.com>
Date: Tue Apr 2 20:01:39 2013 +0200
channel-playback/record: Refuse audio-vol-msgs with 0 channels
Older servers send these, explicitly warn about this, rather then triggering
the following error later:
(remote-viewer:8726): GSpice-WARNING **: set_sink_input_volume() failed: Invalid argument
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c
index 2d542a7..5aa8454 100644
--- a/gtk/channel-playback.c
+++ b/gtk/channel-playback.c
@@ -459,6 +459,11 @@ static void playback_handle_set_volume(SpiceChannel *channel, SpiceMsgIn *in)
SpicePlaybackChannelPrivate *c = SPICE_PLAYBACK_CHANNEL(channel)->priv;
SpiceMsgAudioVolume *vol = spice_msg_in_parsed(in);
+ if (vol->nchannels == 0) {
+ g_warning("spice-server send audio-volume-msg with 0 channels");
+ return;
+ }
+
g_free(c->volume);
c->nchannels = vol->nchannels;
c->volume = g_new(guint16, c->nchannels);
diff --git a/gtk/channel-record.c b/gtk/channel-record.c
index 98a36b6..6345569 100644
--- a/gtk/channel-record.c
+++ b/gtk/channel-record.c
@@ -499,6 +499,11 @@ static void record_handle_set_volume(SpiceChannel *channel, SpiceMsgIn *in)
SpiceRecordChannelPrivate *c = SPICE_RECORD_CHANNEL(channel)->priv;
SpiceMsgAudioVolume *vol = spice_msg_in_parsed(in);
+ if (vol->nchannels == 0) {
+ g_warning("spice-server send audio-volume-msg with 0 channels");
+ return;
+ }
+
g_free(c->volume);
c->nchannels = vol->nchannels;
c->volume = g_new(guint16, c->nchannels);
More information about the Spice-commits
mailing list