diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-05-04 19:35:21 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-05-04 19:35:21 +0000 |
commit | 3866ddb5706f6394286a31b344c36f84f8608eae (patch) | |
tree | ff22a7181205825c47b7e91c832c573102522a2c /usr.bin/aucat/dev.c | |
parent | 4df5077c68a698b90fc4571a3bf0b2c0e3d6f4f0 (diff) |
if the ``device'' is in loopback mode (ie no audio device), then
disable overruns/underruns since aucat must pause when an input or
an output blocks. This is a theoretical fix, since the
start/stop code is never reached in loopback mode
Diffstat (limited to 'usr.bin/aucat/dev.c')
-rw-r--r-- | usr.bin/aucat/dev.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c index fbcb42cb637..4d7a5ffd0ee 100644 --- a/usr.bin/aucat/dev.c +++ b/usr.bin/aucat/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.51 2010/05/02 11:54:26 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.52 2010/05/04 19:35:20 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -585,6 +585,8 @@ dev_start(void) dbg_puts("starting device\n"); #endif dev_pstate = DEV_RUN; + if (dev_mode & MODE_LOOP) + return; if (APROC_OK(dev_mix)) dev_mix->flags |= APROC_DROP; if (APROC_OK(dev_sub)) @@ -609,7 +611,13 @@ dev_stop(void) { struct file *f; +#ifdef DEBUG + if (debug_level >= 2) + dbg_puts("stopping stopped\n"); +#endif dev_pstate = DEV_INIT; + if (dev_mode & MODE_LOOP) + return; if (APROC_OK(dev_play) && dev_play->u.io.file) { f = dev_play->u.io.file; f->ops->stop(f); @@ -623,10 +631,6 @@ dev_stop(void) dev_sub->flags &= ~APROC_DROP; if (APROC_OK(dev_submon)) dev_submon->flags &= ~APROC_DROP; -#ifdef DEBUG - if (debug_level >= 2) - dbg_puts("device stopped\n"); -#endif } int |