CVS commit: src/usr.bin/audio/play
Module Name:src Committed By: gutteridge Date: Fri Apr 10 21:33:27 UTC 2020 Modified Files: src/usr.bin/audio/play: audioplay.1 Log Message: audioplay.1: generalize a reference to web browsers To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.bin/audio/play/audioplay.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audio/play/audioplay.1 diff -u src/usr.bin/audio/play/audioplay.1:1.29 src/usr.bin/audio/play/audioplay.1:1.30 --- src/usr.bin/audio/play/audioplay.1:1.29 Tue Nov 12 12:50:30 2019 +++ src/usr.bin/audio/play/audioplay.1 Fri Apr 10 21:33:27 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: audioplay.1,v 1.29 2019/11/12 12:50:30 wiz Exp $ +.\" $NetBSD: audioplay.1,v 1.30 2020/04/10 21:33:27 gutteridge Exp $ .\" .\" Copyright (c) 1998, 1999, 2002, 2010, 2019 Matthew R. Green .\" All rights reserved. @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 8, 2019 +.Dd April 10, 2020 .Dt AUDIOPLAY 1 .Os .Sh NAME @@ -169,9 +169,8 @@ program can be used to show the availabl .Nm can be used to play Sun/NeXT audio files, and also RIFF WAVE audio files. .Nm -can be configured in the -.Dq Netscape -web browser as the program to use when playing audio files. +can be configured in a web browser as the program to use when playing audio +files. .Pp In addition to the audio driver encodings list in the EXAMPLES section, .Nm
CVS commit: src/usr.bin/audio/play
Module Name:src Committed By: isaki Date: Sat May 4 08:27:30 UTC 2019 Modified Files: src/usr.bin/audio/play: play.c Log Message: Use err(3)/errx(3) properly to avoid "write failed: Undefined error: 0". To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/usr.bin/audio/play/play.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audio/play/play.c diff -u src/usr.bin/audio/play/play.c:1.56 src/usr.bin/audio/play/play.c:1.57 --- src/usr.bin/audio/play/play.c:1.56 Fri Nov 16 13:55:17 2018 +++ src/usr.bin/audio/play/play.c Sat May 4 08:27:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: play.c,v 1.56 2018/11/16 13:55:17 mlelstv Exp $ */ +/* $NetBSD: play.c,v 1.57 2019/05/04 08:27:30 isaki Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002, 2010 Matthew R. Green @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: play.c,v 1.56 2018/11/16 13:55:17 mlelstv Exp $"); +__RCSID("$NetBSD: play.c,v 1.57 2019/05/04 08:27:30 isaki Exp $"); #endif @@ -224,6 +224,7 @@ play(char *file) off_t datasize = 0; ssize_t hdrlen; int fd; + int nw; if (file[0] == '-' && file[1] == 0) { play_fd("standard input", STDIN_FILENO); @@ -283,13 +284,19 @@ play(char *file) } while ((uint64_t)datasize > bufsize) { - if ((size_t)write(audiofd, addr, bufsize) != bufsize) + nw = write(audiofd, addr, bufsize); + if (nw == -1) err(1, "write failed"); + if ((size_t)nw != bufsize) + errx(1, "write failed"); addr = (char *)addr + bufsize; datasize -= bufsize; } - if ((off_t)write(audiofd, addr, datasize) != datasize) + nw = write(audiofd, addr, datasize); + if (nw == -1) err(1, "final write failed"); + if ((off_t)nw != datasize) + errx(1, "final write failed"); if (ioctl(audiofd, AUDIO_DRAIN) < 0 && !qflag) warn("audio drain ioctl failed"); @@ -341,8 +348,10 @@ play_fd(const char *file, int fd) if (datasize != 0 && dataout + nr > datasize) nr = datasize - dataout; nw = write(audiofd, buffer, nr); + if (nw == -1) + err(1, "audio device write failed"); if (nw != nr) - goto write_error; + errx(1, "audio device write failed"); dataout += nw; nr = read(fd, buffer, bufsize); if (nr == -1) @@ -356,8 +365,6 @@ play_fd(const char *file, int fd) return; read_error: err(1, "read of standard input failed"); -write_error: - err(1, "audio device write failed"); } /*
CVS commit: src/usr.bin/audio/play
Module Name:src Committed By: mlelstv Date: Fri Nov 16 13:55:18 UTC 2018 Modified Files: src/usr.bin/audio/play: play.c Log Message: The test for regular file was wrong. >From yarl on freenode, thanks! To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/usr.bin/audio/play/play.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audio/play/play.c diff -u src/usr.bin/audio/play/play.c:1.55 src/usr.bin/audio/play/play.c:1.56 --- src/usr.bin/audio/play/play.c:1.55 Wed Aug 5 06:54:39 2015 +++ src/usr.bin/audio/play/play.c Fri Nov 16 13:55:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: play.c,v 1.55 2015/08/05 06:54:39 mrg Exp $ */ +/* $NetBSD: play.c,v 1.56 2018/11/16 13:55:17 mlelstv Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002, 2010 Matthew R. Green @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: play.c,v 1.55 2015/08/05 06:54:39 mrg Exp $"); +__RCSID("$NetBSD: play.c,v 1.56 2018/11/16 13:55:17 mlelstv Exp $"); #endif @@ -248,7 +248,7 @@ play(char *file) * or if we failed to mmap the file, try to read it instead, so * that filesystems, etc, that do not support mmap() work */ - if (S_ISREG(sb.st_rdev & S_IFMT) == 0 || + if (!S_ISREG(sb.st_mode) || ((off_t)sizet_filesize != filesize) || (oaddr = addr = mmap(0, sizet_filesize, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) {
CVS commit: src/usr.bin/audio/play
Module Name:src Committed By: wiz Date: Wed Dec 29 18:48:41 UTC 2010 Modified Files: src/usr.bin/audio/play: play.c Log Message: Sort usage. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/usr.bin/audio/play/play.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audio/play/play.c diff -u src/usr.bin/audio/play/play.c:1.52 src/usr.bin/audio/play/play.c:1.53 --- src/usr.bin/audio/play/play.c:1.52 Wed Dec 29 14:38:54 2010 +++ src/usr.bin/audio/play/play.c Wed Dec 29 18:48:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: play.c,v 1.52 2010/12/29 14:38:54 jmcneill Exp $ */ +/* $NetBSD: play.c,v 1.53 2010/12/29 18:48:40 wiz Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002, 2010 Matthew R. Green @@ -28,7 +28,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: play.c,v 1.52 2010/12/29 14:38:54 jmcneill Exp $); +__RCSID($NetBSD: play.c,v 1.53 2010/12/29 18:48:40 wiz Exp $); #endif @@ -474,8 +474,8 @@ fprintf(stderr, Usage: %s [-hiqV] [options] files\n, getprogname()); fprintf(stderr, Options:\n\t - -b balance (0-63)\n\t -B buffer size\n\t + -b balance (0-63)\n\t -d audio device\n\t -f force settings\n\t \t-c forced channels\n\t
CVS commit: src/usr.bin/audio/play
Module Name:src Committed By: wiz Date: Wed Dec 29 18:48:56 UTC 2010 Modified Files: src/usr.bin/audio/play: audioplay.1 Log Message: Use better reference after sorting in -f description. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/audio/play/audioplay.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/audio/play/audioplay.1 diff -u src/usr.bin/audio/play/audioplay.1:1.23 src/usr.bin/audio/play/audioplay.1:1.24 --- src/usr.bin/audio/play/audioplay.1:1.23 Wed Dec 29 18:46:48 2010 +++ src/usr.bin/audio/play/audioplay.1 Wed Dec 29 18:48:56 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: audioplay.1,v 1.23 2010/12/29 18:46:48 wiz Exp $ +.\ $NetBSD: audioplay.1,v 1.24 2010/12/29 18:48:56 wiz Exp $ .\ .\ Copyright (c) 1998, 1999, 2002, 2010 Matthew R. Green .\ All rights reserved. @@ -106,8 +106,13 @@ Force playing, even if the format is unknown. The .Fl f -flag can be used in addition with the following flags to -change the number of channels, encoding, precision and +flag can be used in addition with the +.Fl c , +.Fl e , +.Fl P , +and +.Fl s +flags to change the number of channels, encoding, precision, and sample rate. .It Fl h Print a help message.