# HG changeset patch # User reimar # Date 1264245716 0 # Node ID 26d336c4a7a414f6d5e64f797d7e0376d3f07f97 # Parent 3fdf04500df21a4fb582dd73fd5896410ec8195e Support more formats for -ao pcm in raw mode. Patch by Peter Fordham [peter.fordham gmail com] diff -r 3fdf04500df2 -r 26d336c4a7a4 libao2/ao_pcm.c --- a/libao2/ao_pcm.c Sat Jan 23 11:14:18 2010 +0000 +++ b/libao2/ao_pcm.c Sat Jan 23 11:21:56 2010 +0000 @@ -111,32 +111,27 @@ strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm"); } - bits=8; - switch(format){ - case AF_FORMAT_S32_BE: - format=AF_FORMAT_S32_LE; - case AF_FORMAT_S32_LE: - bits=32; - break; - case AF_FORMAT_FLOAT_BE: - format=AF_FORMAT_FLOAT_LE; - case AF_FORMAT_FLOAT_LE: - bits=32; - break; - case AF_FORMAT_S8: - format=AF_FORMAT_U8; - case AF_FORMAT_U8: - break; - case AF_FORMAT_AC3_BE: - case AF_FORMAT_AC3_LE: - bits=16; - break; - default: - format=AF_FORMAT_S16_LE; - bits=16; - break; + if (ao_pcm_waveheader) + { + // WAV files must have one of the following formats + + switch(format){ + case AF_FORMAT_U8: + case AF_FORMAT_S16_LE: + case AF_FORMAT_S24_LE: + case AF_FORMAT_S32_LE: + case AF_FORMAT_FLOAT_LE: + case AF_FORMAT_AC3_BE: + case AF_FORMAT_AC3_LE: + break; + default: + format = AF_FORMAT_S16_LE; + break; + } } + bits = af_fmt2bits(format); + ao_data.outburst = 65536; ao_data.buffersize= 2*65536; ao_data.channels=channels;