[Spice-devel] [PATCH v2] Sound: Fix confusing channel/client terminology
Frediano Ziglio
fziglio at redhat.com
Thu Jan 5 15:47:20 UTC 2017
>
> Previously, the object we now call SndChannel was named SndWorker, and
> the object we now call SndChannelClient was called SndChannel. When
> these names were changed, the functions
> on_new_(record|playback)_channel() were not updated, so the function
> names and the arguments are both a bit confusing now. Update them to
> match the new names.
> ---
>
> Change in v2:
> - rebase on master
>
Not compiling for me, I'm getting:
sound.c: In function 'snd_set_playback_peer':
sound.c:1330:9: error: implicit declaration of function 'on_new_playback_channel' [-Werror=implicit-function-declaration]
on_new_playback_channel(channel, SND_CHANNEL_CLIENT(playback_client));
^~~~~~~~~~~~~~~~~~~~~~~
sound.c:1330:9: error: nested extern declaration of 'on_new_playback_channel' [-Werror=nested-externs]
sound.c: In function 'snd_set_record_peer':
sound.c:1553:5: error: implicit declaration of function 'on_new_record_channel' [-Werror=implicit-function-declaration]
on_new_record_channel(channel, SND_CHANNEL_CLIENT(record_client));
^~~~~~~~~~~~~~~~~~~~~
sound.c:1553:5: error: nested extern declaration of 'on_new_record_channel' [-Werror=nested-externs]
At top level:
sound.c:1508:13: error: 'on_new_record_channel_client' defined but not used [-Werror=unused-function]
static void on_new_record_channel_client(SndChannel *channel, SndChannelClient *client)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound.c:1246:13: error: 'on_new_playback_channel_client' defined but not used [-Werror=unused-function]
static void on_new_playback_channel_client(SndChannel *channel, SndChannelClient *client)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Frediano
>
> server/sound.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/server/sound.c b/server/sound.c
> index 310ff6e..8d2e4c7 100644
> --- a/server/sound.c
> +++ b/server/sound.c
> @@ -1243,21 +1243,21 @@ static int snd_desired_audio_mode(int
> playback_compression, int frequency,
> return SPICE_AUDIO_DATA_MODE_RAW;
> }
>
> -static void on_new_playback_channel(SndChannel *channel, SndChannelClient
> *snd_channel)
> +static void on_new_playback_channel_client(SndChannel *channel,
> SndChannelClient *client)
> {
> RedsState *reds = red_channel_get_server(RED_CHANNEL(channel));
>
> - spice_assert(snd_channel);
> + spice_assert(client);
>
> - channel->connection = snd_channel;
> - snd_set_command(snd_channel, SND_PLAYBACK_MODE_MASK);
> - if (snd_channel->active) {
> - snd_set_command(snd_channel, SND_CTRL_MASK);
> + channel->connection = client;
> + snd_set_command(client, SND_PLAYBACK_MODE_MASK);
> + if (client->active) {
> + snd_set_command(client, SND_CTRL_MASK);
> }
> if (channel->volume.volume_nchannels) {
> - snd_set_command(snd_channel, SND_VOLUME_MASK);
> + snd_set_command(client, SND_VOLUME_MASK);
> }
> - if (snd_channel->active) {
> + if (client->active) {
> reds_disable_mm_time(reds);
> }
> }
> @@ -1505,16 +1505,16 @@ SPICE_GNUC_VISIBLE void
> spice_server_set_record_rate(SpiceRecordInstance *sin, u
> snd_set_rate(&sin->st->channel, frequency, SPICE_RECORD_CAP_OPUS);
> }
>
> -static void on_new_record_channel(SndChannel *channel, SndChannelClient
> *snd_channel)
> +static void on_new_record_channel_client(SndChannel *channel,
> SndChannelClient *client)
> {
> - spice_assert(snd_channel);
> + spice_assert(client);
>
> - channel->connection = snd_channel ;
> + channel->connection = client ;
> if (channel->volume.volume_nchannels) {
> - snd_set_command(snd_channel, SND_VOLUME_MASK);
> + snd_set_command(client, SND_VOLUME_MASK);
> }
> - if (snd_channel->active) {
> - snd_set_command(snd_channel, SND_CTRL_MASK);
> + if (client->active) {
> + snd_set_command(client, SND_CTRL_MASK);
> }
> }
>
More information about the Spice-devel
mailing list