Skip to contentSkip to conversation

Bug in aplay/arecord --list-pcms

PATCH In review Peter Stokes 2 participants 2 messages Jan 11, 2009 – Jan 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bug in aplay/arecord --list-pcms

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

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

aplay/aplay.c +1 -1
index 2e14d2a..837e46a 100644
@@ -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) {
#1 lore raw

At Sun, 11 Jan 2009 15:05:21 +0000,

Quoted 10 lines · Peter Stokes

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.

Quoted 7 lines

Best regards

Peter Stokes

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

Thanks! Applied now.

Takashi

Quoted 20 lines
aplay/aplay.c +1 -1
index 2e14d2a..837e46a 100644
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel