Subject: bin/8390: -f and -P are broken in audiplay
To: None <>
From: None <>
List: netbsd-bugs
Date: 09/12/1999 19:02:47
>Number:         8390
>Category:       bin
>Synopsis:       Audioplay's -f and -e options don't work as advertised.
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 12 18:50:00 1999
>Originator:     Ben Wong
University of Washington
>Release:        NetBSD 1.4.1
i386, NetBSD 1.4.1
System: NetBSD 1.4.1 NetBSD 1.4.1 (AMNESIAC) #6: Sun Sep 12 20:44:36 EDT 1999 i386


audioplay -f is supposed to force audioplay to play a file even if it
doesn't recognize the format. This is broken since
play.c:audioctl_write_fromhdr() returns hdr_len instead of zero. This
causes -f to be ignored and the program quits complaining that the
header is unrecognized.

audioplay -P precision is supposed to set the number of bits per
sample. Unfortunately, there is a typo in the code such that instead of
setting it sets This makes -P
completely useless. This bug is also in audioctl_write_fromhdr().

% audioplay -f /dev/zero
  [Should play silence, instead exits with an error].

% audioplay -P 16 file.wav
  [Should set precision to 16 but instead exits with an error].

Change Line 347 of play.c from:
	return (hdr_len);
	return 0;		/* Forced play: don't skip over header */

and then

Change line 340 of play.c from:

 = precision;
to = precision;