[Spice-devel] [spice-server 08/17] sound: Implement snd_channel_config_socket

Christophe Fergeau cfergeau at redhat.com
Fri Jan 13 13:08:27 UTC 2017


On Wed, Jan 11, 2017 at 06:28:06AM -0500, Frediano Ziglio wrote:
> > @@ -1004,24 +964,68 @@ static SndChannelClient *__new_channel(SndChannel
> > *channel, int size, uint32_t c
> >      client->cleanup = cleanup;
> >  
> >      client->channel_client =
> > -        dummy_channel_client_create(RED_CHANNEL(channel), red_client,
> > +        dummy_channel_client_create(RED_CHANNEL(channel), red_client,
> > stream,
> >                                      num_common_caps, common_caps, num_caps,
> >                                      caps);
> >      if (!client->channel_client) {
> >          goto error2;
> >      }
> > +    snd_channel_config_socket(RED_CHANNEL_CLIENT(client->channel_client));
> > +
> 
> This assumes the function never fails.

Ah right, I've changed it to:
+    if (!snd_channel_config_socket(RED_CHANNEL_CLIENT(client->channel_client))) {
+        goto error2;
+    }

However, there is no easy way to handle the error in
"sound: Turn {Playback,Record}ChannelClient into GObjects" as the call
to snd_channel_config_socket() is now done in a 'constructed' vfunc.
In this commit, I've chosen to just have
    if (!snd_channel_config_socket(RED_CHANNEL_CLIENT(client->channel_client))) {
        g_warning("failed to set sound channel socket parameters");
    }
as the next commit removes direct calls to snd_channel_config_socket()
anyway, and let the generic RedChannel/RedChannelClient code take care
of it.


Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170113/e2d901b3/attachment.sig>


More information about the Spice-devel mailing list