diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-08 09:52:55 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-08 09:52:55 +0000 |
commit | ecb5105a2cb4a476115f232b435ed2f0abf21279 (patch) | |
tree | 968b21fa0751a119c754748cfe644fa363e22cf7 /libao2 | |
parent | 6404bc9c46b552f5120ba6773b32870e4e5fbad6 (diff) |
disable all unknown formats in the windows aos
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14136 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_dsound.c | 11 | ||||
-rw-r--r-- | libao2/ao_win32.c | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index 21c293a380..0344c7410e 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -364,6 +364,17 @@ static int init(int rate, int channels, int format, int flags) 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; diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index 698e2d727b..ba004c7b26 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -148,6 +148,16 @@ static int init(int rate,int channels,int format,int flags) 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; |