Exclude mixer channels from channel numbering.

This commit is contained in:
nat 2017-04-03 04:09:12 +00:00
parent 96ab71d5fd
commit 49116e8b2e

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio.c,v 1.319 2017/03/29 06:24:22 nat Exp $ */
/* $NetBSD: audio.c,v 1.320 2017/04/03 04:09:12 nat Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.319 2017/03/29 06:24:22 nat Exp $");
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.320 2017/04/03 04:09:12 nat Exp $");
#include "audio.h"
#if NAUDIO > 0
@ -2088,6 +2088,8 @@ audio_open(dev_t dev, struct audio_softc *sc, int flags, int ifmt,
SIMPLEQ_FOREACH(chan, &sc->sc_audiochan, entries) {
if (chan == SIMPLEQ_FIRST(&sc->sc_audiochan))
continue;
if (chan->chan == MIXER_INUSE)
continue;
n = chan->chan + 1;
}
if (n < 0)