Module Name:    src
Committed By:   jmcneill
Date:           Mon Sep  7 16:41:37 UTC 2009

Modified Files:
        src/sys/dev/pci/hdaudio: hdaudio_afg.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/hdaudio/hdaudio_afg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.6 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.7
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.6	Mon Sep  7 16:21:08 2009
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Mon Sep  7 16:41:37 2009
@@ -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 <[email protected]>
@@ -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);
 	}

Reply via email to