From 2ede31567194bba6d6fb98ea76ee669dc67c1d26 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Thu, 18 Jun 2009 22:55:57 +0000 Subject: fix previous: start playback when at least one block of data has been written to the device, instead of waiting for a write(2) when the buffer is or will be over the high water mark. ok ratchov@ --- sys/dev/audio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sys') diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 0ffdad02623..7bfd842382a 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.103 2009/03/21 13:16:21 ratchov Exp $ */ +/* $OpenBSD: audio.c,v 1.104 2009/06/18 22:55:56 jakemsr Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -1504,13 +1504,6 @@ audio_write(dev_t dev, struct uio *uio, int ioflag) while (cb->used >= cb->usedhigh) { DPRINTFN(2, ("audio_write: sleep used=%d lowat=%d hiwat=%d\n", cb->used, cb->usedlow, cb->usedhigh)); - if (!sc->sc_pbus && !cb->pause) { - error = audiostartp(sc); - if (error) { - splx(s); - return error; - } - } if (ioflag & IO_NDELAY) { splx(s); return (EWOULDBLOCK); @@ -1540,6 +1533,13 @@ audio_write(dev_t dev, struct uio *uio, int ioflag) * silence in the buffer, but it is simple. */ sc->sc_sil_count = 0; + if (!sc->sc_pbus && !cb->pause && cb->used >= cb->blksize) { + error = audiostartp(sc); + if (error) { + splx(s); + return error; + } + } splx(s); cc /= sc->sc_pparams.factor; DPRINTFN(1, ("audio_write: uiomove cc=%d inp=%p, left=%d\n", -- cgit v1.2.3