summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 15:59:53 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 15:59:53 +0200
commite28e4a1b157bd0e9620fcff956d713a9921f506c (patch)
treed92e54e1e25feb84e692396cf234478f403e5738 /libao2
parent560acfd0407c757e17bf72b490687d4947b05675 (diff)
parent213092c8dcfc925d8d54cf320b60cf298a870696 (diff)
downloadmpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.bz2
mpv-e28e4a1b157bd0e9620fcff956d713a9921f506c.tar.xz
Merge svn changes up to r30419
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_pcm.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c
index 5c418d0f5a..a9fab6581e 100644
--- a/libao2/ao_pcm.c
+++ b/libao2/ao_pcm.c
@@ -111,32 +111,27 @@ static int init(int rate,int channels,int format,int flags){
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;