All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Stokes <linux@dadeos.co.uk>
To: alsa-devel@alsa-project.org
Subject: [PATCH] Bug in aplay/arecord --list-pcms
Date: Sun, 11 Jan 2009 15:05:21 +0000	[thread overview]
Message-ID: <200901111505.21730.linux@dadeos.co.uk> (raw)

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) {

             reply	other threads:[~2009-01-11 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 15:05 Peter Stokes [this message]
2009-01-12 11:32 ` [PATCH] Bug in aplay/arecord --list-pcms Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901111505.21730.linux@dadeos.co.uk \
    --to=linux@dadeos.co.uk \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.