summaryrefslogtreecommitdiff
path: root/usr.bin/audioctl
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-04-25 06:43:50 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-04-25 06:43:50 +0000
commitbe8ad1df6598020d37cbca218167a6434e9a1e11 (patch)
tree908065d90ada401d4a89d593322ab8a8e5c32a94 /usr.bin/audioctl
parentd42c9f648a034265a8364cb0012b9e781b98a676 (diff)
display count of playback frame errors (underruns) in play.errors like we
do with record.errors for recording (overruns). ok ratchov
Diffstat (limited to 'usr.bin/audioctl')
-rw-r--r--usr.bin/audioctl/audioctl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c
index 04305859c70..3d04efbf683 100644
--- a/usr.bin/audioctl/audioctl.c
+++ b/usr.bin/audioctl/audioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audioctl.c,v 1.17 2008/03/22 11:05:31 ratchov Exp $ */
+/* $OpenBSD: audioctl.c,v 1.18 2008/04/25 06:43:49 jakemsr Exp $ */
/* $NetBSD: audioctl.c,v 1.14 1998/04/27 16:55:23 augustss Exp $ */
/*
@@ -66,7 +66,7 @@ audio_info_t info;
char encbuf[1000];
-int properties, fullduplex, rerror;
+int properties, fullduplex, perrors, rerrors;
struct field {
const char *name;
@@ -118,6 +118,7 @@ struct field {
{ "play.active", &info.play.active, UCHAR, READONLY },
{ "play.buffer_size", &info.play.buffer_size, UINT, 0 },
{ "play.block_size", &info.play.block_size, UINT, 0 },
+ { "play.errors", &perrors, INT, READONLY },
{ "record.rate", &info.record.sample_rate,UINT, 0 },
{ "record.sample_rate", &info.record.sample_rate,UINT, ALIAS },
{ "record.channels", &info.record.channels, UINT, 0 },
@@ -137,7 +138,7 @@ struct field {
{ "record.active", &info.record.active, UCHAR, READONLY },
{ "record.buffer_size", &info.record.buffer_size,UINT, 0 },
{ "record.block_size", &info.record.block_size,UINT, 0 },
- { "record.errors", &rerror, INT, READONLY },
+ { "record.errors", &rerrors, INT, READONLY },
{ 0 }
};
@@ -313,7 +314,9 @@ getinfo(int fd)
err(1, "AUDIO_GETFD");
if (ioctl(fd, AUDIO_GETPROPS, &properties) < 0)
err(1, "AUDIO_GETPROPS");
- if (ioctl(fd, AUDIO_RERROR, &rerror) < 0)
+ if (ioctl(fd, AUDIO_PERROR, &perrors) < 0)
+ err(1, "AUDIO_PERROR");
+ if (ioctl(fd, AUDIO_RERROR, &rerrors) < 0)
err(1, "AUDIO_RERROR");
if (ioctl(fd, AUDIO_GETINFO, &info) < 0)
err(1, "AUDIO_GETINFO");