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@xxxxxxxxxx> --- gtk/channel-playback.c | 5 +++++ gtk/channel-record.c | 5 +++++ 2 files changed, 10 insertions(+) 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); -- 1.8.1.4 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel