[Spice-devel] [spice-protocol PATCH v4] audio: Do not volume-sync without audio

Victor Toso victortoso at redhat.com
Tue Sep 8 02:47:17 PDT 2015


Thanks,

This is now pushed:
http://cgit.freedesktop.org/spice/spice-gtk/commit/?id=a99ed1524b075

Cheers,
  toso

On Mon, Sep 07, 2015 at 01:22:22PM +0200, Pavel Grunt wrote:
> Ack,
> 
> Pavel
> 
> On Mon, 2015-09-07 at 11:55 +0200, Victor Toso wrote:
> > In case audio backend is not initialized correctly or there isn't audio
> > in the VM, we should not try to volume-sync.
> > 
> > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1257210
> > ---
> >  src/channel-main.c | 6 ++++--
> >  src/spice-audio.c  | 4 ++++
> >  2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/channel-main.c b/src/channel-main.c
> > index f5115aa..145b081 100644
> > --- a/src/channel-main.c
> > +++ b/src/channel-main.c
> > @@ -1159,7 +1159,8 @@ static void agent_sync_audio_playback(SpiceMainChannel
> > *main_channel)
> >      SpiceAudio *audio = spice_audio_get(session, NULL);
> >      SpiceMainChannelPrivate *c = main_channel->priv;
> >  
> > -    if (!test_agent_cap(main_channel, VD_AGENT_CAP_AUDIO_VOLUME_SYNC) ||
> > +    if (audio == NULL ||
> > +        !test_agent_cap(main_channel, VD_AGENT_CAP_AUDIO_VOLUME_SYNC) ||
> >          c->agent_volume_playback_sync == TRUE) {
> >          SPICE_DEBUG("%s - is not going to sync audio with guest", __func__);
> >          return;
> > @@ -1215,7 +1216,8 @@ static void agent_sync_audio_record(SpiceMainChannel
> > *main_channel)
> >      SpiceAudio *audio = spice_audio_get(session, NULL);
> >      SpiceMainChannelPrivate *c = main_channel->priv;
> >  
> > -    if (!test_agent_cap(main_channel, VD_AGENT_CAP_AUDIO_VOLUME_SYNC) ||
> > +    if (audio == NULL ||
> > +        !test_agent_cap(main_channel, VD_AGENT_CAP_AUDIO_VOLUME_SYNC) ||
> >          c->agent_volume_record_sync == TRUE) {
> >          SPICE_DEBUG("%s - is not going to sync audio with guest", __func__);
> >          return;
> > diff --git a/src/spice-audio.c b/src/spice-audio.c
> > index ce191e1..3bf2217 100644
> > --- a/src/spice-audio.c
> > +++ b/src/spice-audio.c
> > @@ -197,6 +197,7 @@ void
> > spice_audio_get_playback_volume_info_async(SpiceAudio *audio,
> >                                                  GAsyncReadyCallback callback,
> >                                                  gpointer user_data)
> >  {
> > +    g_return_if_fail (audio != NULL);
> >      SPICE_AUDIO_GET_CLASS(audio)->get_playback_volume_info_async(audio,
> >              cancellable, main_channel, callback, user_data);
> >  }
> > @@ -208,6 +209,7 @@ gboolean
> > spice_audio_get_playback_volume_info_finish(SpiceAudio *audio,
> >                                                       guint16 **volume,
> >                                                       GError **error)
> >  {
> > +    g_return_val_if_fail (audio != NULL, FALSE);
> >      return SPICE_AUDIO_GET_CLASS(audio)-
> > >get_playback_volume_info_finish(audio,
> >              res, mute, nchannels, volume, error);
> >  }
> > @@ -218,6 +220,7 @@ void spice_audio_get_record_volume_info_async(SpiceAudio
> > *audio,
> >                                                GAsyncReadyCallback callback,
> >                                                gpointer user_data)
> >  {
> > +    g_return_if_fail (audio != NULL);
> >      SPICE_AUDIO_GET_CLASS(audio)->get_record_volume_info_async(audio,
> >              cancellable, main_channel, callback, user_data);
> >  }
> > @@ -229,6 +232,7 @@ gboolean
> > spice_audio_get_record_volume_info_finish(SpiceAudio *audio,
> >                                                     guint16 **volume,
> >                                                     GError **error)
> >  {
> > +    g_return_val_if_fail (audio != NULL, FALSE);
> >      return SPICE_AUDIO_GET_CLASS(audio)->get_record_volume_info_finish(audio,
> >              res, mute, nchannels, volume, error);
> >  }


More information about the Spice-devel mailing list