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 Properly initialize struct audio_format ...



details:   https://anonhg.NetBSD.org/src/rev/ac16a6c0f7f1
branches:  trunk
changeset: 747265:ac16a6c0f7f1
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 07 16:41:37 2009 +0000

description:
Properly initialize struct audio_format when applying the 0ch workaround.

diffstat:

 sys/dev/pci/hdaudio/hdaudio_afg.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 30d162736a89 -r ac16a6c0f7f1 sys/dev/pci/hdaudio/hdaudio_afg.c
--- a/sys/dev/pci/hdaudio/hdaudio_afg.c Mon Sep 07 16:35:02 2009 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio_afg.c Mon Sep 07 16:41:37 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.6 2009/09/07 16:21:08 jmcneill Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.7 2009/09/07 16:41:37 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: hdaudio_afg.c,v 1.6 2009/09/07 16:21:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.7 2009/09/07 16:41:37 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2908,8 +2908,16 @@
         * the direction.
         */
        if (sc->sc_rchan == 0 || sc->sc_pchan == 0) {
+               memset(&f, 0, sizeof(f));
+               f.driver_data = NULL;
+               f.mode = 0;
+               f.encoding = AUDIO_ENCODING_SLINEAR_LE;
+               f.validbits = 16;
+               f.precision = 16;
                f.channels = 2;
                f.channel_mask = AUFMT_STEREO;
+               f.frequency_type = 0;
+               f.frequency[0] = f.frequency[1] = 48000;
                f.mode = AUMODE_PLAY|AUMODE_RECORD;
                hdaudio_afg_append_formats(&sc->sc_audiodev, &f);
        }



Home | Main Index | Thread Index | Old Index