[Spice-devel] [PATCH v2 3/6] sound: Remove dead code in client constructors
Jonathon Jongsma
jjongsma at redhat.com
Tue Apr 25 13:43:43 UTC 2017
On Tue, 2017-04-25 at 14:49 +0200, Christophe Fergeau wrote:
> On Mon, Apr 24, 2017 at 12:09:38PM -0500, Jonathon Jongsma wrote:
> > When a new PlaybackChannelClient or RecordChannelClient is created,
> > there are several places where we make decisions based on whether
> > the
> > client is active or not. But these checks are done before the
> > 'active'
> > flag is ever set, so this code is effectively dead. This has been
> > the
> > case since the very first commit in this repository.
> >
> > Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
>
> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
Hmm, I remember changing this commit log based on Frediano's comment in
the first version of this series, but it seems I sent the new version
with the old commit log. I need to check what happened...
>
> > ---
> > server/sound.c | 10 ----------
> > 1 file changed, 10 deletions(-)
> >
> > diff --git a/server/sound.c b/server/sound.c
> > index 3eb6a03..b5abf47 100644
> > --- a/server/sound.c
> > +++ b/server/sound.c
> > @@ -1039,7 +1039,6 @@ playback_channel_client_constructed(GObject
> > *object)
> > RedChannel *red_channel = red_channel_client_get_channel(rcc);
> > SndChannel *channel = SND_CHANNEL(red_channel);
> > RedClient *red_client = red_channel_client_get_client(rcc);
> > - RedsState *reds = red_channel_get_server(red_channel);
> > SndChannelClient *scc = SND_CHANNEL_CLIENT(playback_client);
> >
> > G_OBJECT_CLASS(playback_channel_client_parent_class)-
> > >constructed(object);
> > @@ -1069,15 +1068,9 @@ playback_channel_client_constructed(GObject
> > *object)
> > channel->connection = scc;
> > if (!red_client_during_migrate_at_target(red_client)) {
> > snd_set_command(scc, SND_PLAYBACK_MODE_MASK);
> > - if (scc->active) {
> > - snd_set_command(scc, SND_CTRL_MASK);
> > - }
> > if (channel->volume.volume_nchannels) {
> > snd_set_command(scc, SND_VOLUME_MUTE_MASK);
> > }
> > - if (scc->active) {
> > - reds_disable_mm_time(reds);
> > - }
> > }
> >
> > if (channel->active) {
> > @@ -1271,9 +1264,6 @@ record_channel_client_constructed(GObject
> > *object)
> > if (channel->volume.volume_nchannels) {
> > snd_set_command(scc, SND_VOLUME_MUTE_MASK);
> > }
> > - if (scc->active) {
> > - snd_set_command(scc, SND_CTRL_MASK);
> > - }
> >
> > if (channel->active) {
> > snd_record_start(channel);
> > --
> > 2.9.3
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list