Subject: bin/30612: audiorecord(1) does not copy correctly the existing audio settings
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <netbsd@xstnz.tk>
List: netbsd-bugs
Date: 06/27/2005 17:33:00
>Number:         30612
>Category:       bin
>Synopsis:       audiorecord(1) does not copy correctly the existing audio settings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 27 17:33:00 +0000 2005
>Originator:     Martin Jerabek
>Release:        2.0.2
>Organization:
>Environment:
NetBSD i4.xstnz.tk 2.0.2 NetBSD 2.0.2 (I4ADJ) #1: Sun Jun 26 19:45:56 CEST 2005  root@i4.xstnz.tk:/usr/src/sys/arch/i386/compile/I4ADJ i386
>Description:
If one or more record format parameters are not defined on the command line, the existing audio settings are not used instead as the code intends to do. Since the new settings are initialized with AUDIO_INITINFO before the ioctl call the AUDIO_SETINFO ioctl call will fail with EINVAL.
>How-To-Repeat:
audiorecord foo.wav
>Fix:
--- record_org.c	2005-06-27 18:53:55.000000000 +0200
+++ record.c	2005-06-27 18:54:27.000000000 +0200
@@ -261,7 +261,7 @@
 	/*
 	 * for these, get the current values for stuffing into the header
 	 */
-#define SETINFO(x)	if (x) info.record.x = x; else x = oinfo.record.x
+#define SETINFO(x)	if (x) info.record.x = x; else info.record.x = oinfo.record.x
 	SETINFO (sample_rate);
 	SETINFO (channels);
 	SETINFO (precision);