Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/hdaudio hdafg_stream_connect: if connecting a no...
details: https://anonhg.NetBSD.org/src/rev/d68daa867540
branches: trunk
changeset: 769361:d68daa867540
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed Sep 07 00:16:40 2011 +0000
description:
hdafg_stream_connect: if connecting a non-PCM stream, make sure only
converters that support non-PCM formats are configured to decode it
diffstat:
sys/dev/pci/hdaudio/hdafg.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diffs (44 lines):
diff -r ba36872e57f5 -r d68daa867540 sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c Wed Sep 07 00:11:58 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c Wed Sep 07 00:16:40 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.4 2011/09/06 11:14:17 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.5 2011/09/07 00:16:40 jmcneill Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.4 2011/09/06 11:14:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.5 2011/09/07 00:16:40 jmcneill Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -3100,6 +3100,15 @@
if (as[i].as_activated == false)
c = 0;
+ /*
+ * If a non-PCM stream is being connected, and the
+ * converter doesn't support non-PCM streams, then
+ * don't decode it
+ */
+ if ((fmt & HDAUDIO_FMT_TYPE_NONPCM) &&
+ !(w->w_p.stream_format & COP_STREAM_FORMAT_AC3))
+ c = 0;
+
hdaudio_command(sc->sc_codec, w->w_nid,
CORB_SET_CONVERTER_FORMAT, fmt);
if (w->w_p.aw_cap & COP_AWCAP_DIGITAL) {
@@ -3118,7 +3127,8 @@
}
hdaudio_command(sc->sc_codec, w->w_nid,
CORB_SET_CONVERTER_STREAM_CHANNEL, c);
- chn += COP_AWCAP_CHANNEL_COUNT(w->w_p.aw_cap);
+ if (c != 0)
+ chn += COP_AWCAP_CHANNEL_COUNT(w->w_p.aw_cap);
}
for (j = 0; j < HDAUDIO_MAXPINS; j++) {
Home |
Main Index |
Thread Index |
Old Index