[MPlayer-cvslog] r30400 - trunk/libao2/ao_pcm.c
reimar
subversion at mplayerhq.hu
Sat Jan 23 12:21:56 CET 2010
Author: reimar
Date: Sat Jan 23 12:21:56 2010
New Revision: 30400
Log:
Support more formats for -ao pcm in raw mode.
Patch by Peter Fordham [peter.fordham gmail com]
Modified:
trunk/libao2/ao_pcm.c
Modified: trunk/libao2/ao_pcm.c
==============================================================================
--- trunk/libao2/ao_pcm.c Sat Jan 23 12:14:18 2010 (r30399)
+++ trunk/libao2/ao_pcm.c Sat Jan 23 12:21:56 2010 (r30400)
@@ -111,32 +111,27 @@ static int init(int rate,int channels,in
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;
More information about the MPlayer-cvslog
mailing list