Re: [PATCH] winealsa.drv: Count micelem in mixer chans, don't add spare capture input for half-duplex mics.
On Wed, Sep 1, 2010 at 9:40 AM, Alexandre Julliard wrote: > This statement wasn't exactly clear before, but now it's really > impossible to follow. Please rewrite this in a way that makes sense to a > casual reader. I have rewritten this in a more readable way and submitted the result to wine-patches. See http://source.winehq.org/patches/data/67063 . -Jeff
Re: [PATCH] winealsa.drv: Count micelem in mixer chans, don't add spare capture input for half-duplex mics.
Den 2010-09-05 11:45 skrev David Laight: > On Wed, Sep 01, 2010 at 05:40:35PM +0200, Alexandre Julliard wrote: >> Jeff Cook writes: >> >>> @@ -520,7 +520,12 @@ static void ALSA_MixerInit(void) >>> } >>> >>> /* Add master channel, uncounted channels and an extra for capture >>> */ >>> -mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + 1; >>> +/* Do not add the extra channel needed for capture on half-duplex >>> capture cards >>> + like snd_usb_audio mics */ >>> +if (micelem && !mastelem && !captelem) >>> +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + >>> !!micelem; >>> +else >>> +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + >>> !!micelem + 1; >> >> This statement wasn't exactly clear before, but now it's really >> impossible to follow. Please rewrite this in a way that makes sense to a >> casual reader. > > Clearly it should be: > mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + > (micelem && !mastelem && !captelem); > ducks quickly ... :-) Clearly not, since it is harder to debug code than to write it, and you failed to write it correctly in the first place (assuming the patch was indeed correct). Good thing you ducked... :-) Cheers, Peter
Re: [PATCH] winealsa.drv: Count micelem in mixer chans, don't add spare capture input for half-duplex mics.
On Wed, Sep 01, 2010 at 05:40:35PM +0200, Alexandre Julliard wrote: > Jeff Cook writes: > > > @@ -520,7 +520,12 @@ static void ALSA_MixerInit(void) > > } > > > > /* Add master channel, uncounted channels and an extra for capture > > */ > > -mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + 1; > > +/* Do not add the extra channel needed for capture on half-duplex > > capture cards > > + like snd_usb_audio mics */ > > +if (micelem && !mastelem && !captelem) > > +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + > > !!micelem; > > +else > > +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + > > !!micelem + 1; > > This statement wasn't exactly clear before, but now it's really > impossible to follow. Please rewrite this in a way that makes sense to a > casual reader. Clearly it should be: mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + (micelem && !mastelem && !captelem); ducks quickly ... :-) David -- David Laight: da...@l8s.co.uk
Re: [PATCH] winealsa.drv: Count micelem in mixer chans, don't add spare capture input for half-duplex mics.
Jeff Cook writes: > @@ -520,7 +520,12 @@ static void ALSA_MixerInit(void) > } > > /* Add master channel, uncounted channels and an extra for capture > */ > -mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + 1; > +/* Do not add the extra channel needed for capture on half-duplex > capture cards > + like snd_usb_audio mics */ > +if (micelem && !mastelem && !captelem) > +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + > !!micelem; > +else > +mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + > !!micelem + 1; This statement wasn't exactly clear before, but now it's really impossible to follow. Please rewrite this in a way that makes sense to a casual reader. -- Alexandre Julliard julli...@winehq.org