All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bug in aplay/arecord --list-pcms
@ 2009-01-11 15:05 Peter Stokes
  2009-01-12 11:32 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stokes @ 2009-01-11 15:05 UTC (permalink / raw)
  To: alsa-devel

Hi,

I have just discovered a minor logic inversion bug in aplay/arecord --list-pcms functionality.

Basically, executing "aplay --list-pcms" lists all devices capable of capture and executing "arecord --list-pcms" 
lists all devices capable of playback.

Please find below a patch to resolve this issue.

Best regards

Peter Stokes

-------------------------------------------------------------------------------

Signed-off-by: Peter Stokes <linux@dadeos.co.uk>

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 2e14d2a..837e46a 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -287,7 +287,7 @@ static void pcm_list(void)
                name = snd_device_name_get_hint(*n, "NAME");
                descr = snd_device_name_get_hint(*n, "DESC");
                io = snd_device_name_get_hint(*n, "IOID");
-               if (io != NULL && strcmp(io, filter) == 0)
+               if (io != NULL && strcmp(io, filter) != 0)
                        goto __end;
                printf("%s\n", name);
                if ((descr1 = descr) != NULL) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bug in aplay/arecord --list-pcms
  2009-01-11 15:05 [PATCH] Bug in aplay/arecord --list-pcms Peter Stokes
@ 2009-01-12 11:32 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-01-12 11:32 UTC (permalink / raw)
  To: Peter Stokes; +Cc: alsa-devel

At Sun, 11 Jan 2009 15:05:21 +0000,
Peter Stokes wrote:
> 
> Hi,
> 
> I have just discovered a minor logic inversion bug in aplay/arecord --list-pcms functionality.
> 
> Basically, executing "aplay --list-pcms" lists all devices capable of capture and executing "arecord --list-pcms" 
> lists all devices capable of playback.
> 
> Please find below a patch to resolve this issue.
> 
> Best regards
> 
> Peter Stokes
> 
> -------------------------------------------------------------------------------
> 
> Signed-off-by: Peter Stokes <linux@dadeos.co.uk>

Thanks!  Applied now.


Takashi

> 
> diff --git a/aplay/aplay.c b/aplay/aplay.c
> index 2e14d2a..837e46a 100644
> --- a/aplay/aplay.c
> +++ b/aplay/aplay.c
> @@ -287,7 +287,7 @@ static void pcm_list(void)
>                 name = snd_device_name_get_hint(*n, "NAME");
>                 descr = snd_device_name_get_hint(*n, "DESC");
>                 io = snd_device_name_get_hint(*n, "IOID");
> -               if (io != NULL && strcmp(io, filter) == 0)
> +               if (io != NULL && strcmp(io, filter) != 0)
>                         goto __end;
>                 printf("%s\n", name);
>                 if ((descr1 = descr) != NULL) {
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-12 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-11 15:05 [PATCH] Bug in aplay/arecord --list-pcms Peter Stokes
2009-01-12 11:32 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.