[Spice-devel] [PATCH spice-server v3] sound: Remove sound channel global list

Christophe Fergeau cfergeau at redhat.com
Tue May 9 16:01:22 UTC 2017


On Tue, May 09, 2017 at 03:34:44PM +0100, Frediano Ziglio wrote:
> Use channel list to iterate all channels.

Use the channel list from RedState to iterate over all channels

> This remove another global variable still left.

This removes one more global variable

> -void snd_set_playback_latency(RedClient *client, uint32_t latency)
> +void snd_set_playback_channel_latency(RedChannel *red_channel, RedClient *client,
> +                                      uint32_t latency)
>  {
> -    GList *l;
> +    if (!IS_PLAYBACK_CHANNEL(red_channel)) {
> +        return;
> +    }

Having a method which will silently ignore invalid objects is fairly
unusual (in this case, even
snd_set_playback_channel_latency(gtk_window_new(), ...) would "work").
Can the IS_PLAYBACK_CHANNEL() check be moved to the reds.c callers, with
the assumption that red_channel has to be of the appropriate type here?
(and same comment for set_playback_compression).

Apart from this, this looks good.

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/20170509/da2052b1/attachment.sig>


More information about the Spice-devel mailing list