changeset 14135:234295985ccd

disable all unknown formats in the windows aos
author faust3
date Wed, 08 Dec 2004 09:52:55 +0000
parents 8c839bb8a076
children b3133af9666d
files libao2/ao_dsound.c libao2/ao_win32.c
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_dsound.c	Wed Dec 08 00:02:45 2004 +0000
+++ b/libao2/ao_dsound.c	Wed Dec 08 09:52:55 2004 +0000
@@ -364,6 +364,17 @@
 	DSBUFFERDESC dsbpridesc;
 	DSBUFFERDESC dsbdesc;
 
+	//check if the format is supported in general
+	switch(format){
+		case AFMT_AC3:
+		case AFMT_S24_LE:
+		case AFMT_S16_LE:
+		case AFMT_S8:
+			break;
+		default:
+			mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format));
+			format=AFMT_S16_LE;
+	}   	
 	//fill global ao_data
 	ao_data.channels = channels;
 	ao_data.samplerate = rate;
--- a/libao2/ao_win32.c	Wed Dec 08 00:02:45 2004 +0000
+++ b/libao2/ao_win32.c	Wed Dec 08 09:52:55 2004 +0000
@@ -148,6 +148,16 @@
 	unsigned char* buffer;
 	int i;
    
+	switch(format){
+		case AFMT_AC3:
+		case AFMT_S24_LE:
+		case AFMT_S16_LE:
+		case AFMT_S8:
+			break;
+		default:
+			mp_msg(MSGT_AO, MSGL_V,"ao_win32: format %s not supported defaulting to Signed 16-bit Little-Endian\n",audio_out_format_name(format));
+			format=AFMT_S16_LE;
+	}   
 	//fill global ao_data 
 	ao_data.channels=channels;
 	ao_data.samplerate=rate;