[PATCH] alsaloop: Correct check in if condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Date: Mon, 23 Jan 2017 11:45:13 +0100

Fix the error below found by gcc (Debian 6.3.0-4) 6.3.0 20170121.

```
gcc -DHAVE_CONFIG_H -I. -I../include -I../include -D_GNU_SOURCE -O2 -Wall -pipe -g -MT pcmjob.o -MD -MP -MF .deps/pcmjob.Tpo -c -o pcmjob.o pcmjob.c
pcmjob.c: In function 'pcmjob_start':
pcmjob.c:1482:27: warning: self-comparison always evaluates to true [-Wtautological-compare]
      loop->play->channels == loop->play->channels &&
                           ^~
```

Judging from the surrounding code, the check should make sure the
channels of the play and capture device are equal.

Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
---
I hope, this patch gets through without any mangling from Mozilla Thunderbird.

 alsaloop/pcmjob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 4df59e8..2be0732 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1479,7 +1479,7 @@ __again:
 	if (loop->play->access == loop->capt->access &&
 	    loop->play->format == loop->capt->format &&
 	    loop->play->rate == loop->capt->rate &&
-	    loop->play->channels == loop->play->channels &&
+	    loop->play->channels == loop->capt->channels &&
 	    loop->sync != SYNC_TYPE_SAMPLERATE) {
 		if (verbose > 1)
 			snd_output_printf(loop->output, "shared buffer!!!\n");
--
2.4.1
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux