Module Name:    src
Committed By:   mlelstv
Date:           Sun Apr 23 08:53:08 UTC 2023

Modified Files:
        src/sys/dev/audio: audio.c

Log Message:
print stage formats with AUDIO_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.142 src/sys/dev/audio/audio.c:1.143
--- src/sys/dev/audio/audio.c:1.142	Sun Apr 23 08:38:53 2023
+++ src/sys/dev/audio/audio.c	Sun Apr 23 08:53:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.142 2023/04/23 08:38:53 mlelstv Exp $	*/
+/*	$NetBSD: audio.c,v 1.143 2023/04/23 08:53:08 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -181,7 +181,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.142 2023/04/23 08:38:53 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.143 2023/04/23 08:53:08 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4764,25 +4764,35 @@ audio_track_set_format(audio_track_t *tr
 		if ((error = audio_track_init_freq(track, &last_dst)) != 0)
 			goto error;
 	}
-#if 0
-	/* debug */
-	if (track->freq.filter) {
-		audio_print_format2("freq src", &track->freq.srcbuf.fmt);
-		audio_print_format2("freq dst", &track->freq.dst->fmt);
-	}
-	if (track->chmix.filter) {
-		audio_print_format2("chmix src", &track->chmix.srcbuf.fmt);
-		audio_print_format2("chmix dst", &track->chmix.dst->fmt);
-	}
-	if (track->chvol.filter) {
-		audio_print_format2("chvol src", &track->chvol.srcbuf.fmt);
-		audio_print_format2("chvol dst", &track->chvol.dst->fmt);
-	}
-	if (track->codec.filter) {
-		audio_print_format2("codec src", &track->codec.srcbuf.fmt);
-		audio_print_format2("codec dst", &track->codec.dst->fmt);
+
+#if defined(AUDIO_DEBUG)
+	if (audiodebug >= 3) {
+		if (track->freq.filter) {
+			audio_print_format2("freq src",
+			    &track->freq.srcbuf.fmt);
+			audio_print_format2("freq dst",
+			    &track->freq.dst->fmt);
+		}
+		if (track->chmix.filter) {
+			audio_print_format2("chmix src",
+			    &track->chmix.srcbuf.fmt);
+			audio_print_format2("chmix dst",
+			    &track->chmix.dst->fmt);
+		}
+		if (track->chvol.filter) {
+			audio_print_format2("chvol src",
+			    &track->chvol.srcbuf.fmt);
+			audio_print_format2("chvol dst",
+			    &track->chvol.dst->fmt);
+		}
+		if (track->codec.filter) {
+			audio_print_format2("codec src",
+			    &track->codec.srcbuf.fmt);
+			audio_print_format2("codec dst",
+			    &track->codec.dst->fmt);
+		}
 	}
-#endif
+#endif /* AUDIO_DEBUG */
 
 	/* Stage input buffer */
 	track->input = last_dst;

Reply via email to