diff libao2/ao_dsound.c @ 29826:4eae69f3f4f4

Add support for 8 channel audio. Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we fail gracefully.
author tack
date Tue, 10 Nov 2009 00:45:19 +0000
parents 2eff450157cd
children 1c55c7f6874b
line wrap: on
line diff
--- a/libao2/ao_dsound.c	Tue Nov 10 00:43:14 2009 +0000
+++ b/libao2/ao_dsound.c	Tue Nov 10 00:45:19 2009 +0000
@@ -426,7 +426,12 @@
 	DSBUFFERDESC dsbpridesc;
 	DSBUFFERDESC dsbdesc;
 
-	//check if the format is supported in general
+	//check if the channel count and format is supported in general
+	if (channels > 6) {
+		UninitDirectSound();
+		mp_msg(MSGT_AO, MSGL_ERR, "ao_dsound: 8 channel audio not yet supported\n");
+		return 0;
+	}
 	switch(format){
 		case AF_FORMAT_AC3:
 		case AF_FORMAT_S24_LE: