summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-01 16:58:52 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-05-01 16:58:52 +0000
commit0f5ee4b7bd64a4fbd76fa4de0a863ce75b746c25 (patch)
tree9dccd420ef55875e1b424ee701717fc589efdd77 /libao2
parent71247a97b35fd6ffe93883f883530f4569ee9bcb (diff)
downloadmpv-0f5ee4b7bd64a4fbd76fa4de0a863ce75b746c25.tar.bz2
mpv-0f5ee4b7bd64a4fbd76fa4de0a863ce75b746c25.tar.xz
Support 32 bit float and integer formats in ao_pcm.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26636 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_pcm.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c
index 7182630fe2..7b6e71a38c 100644
--- a/libao2/ao_pcm.c
+++ b/libao2/ao_pcm.c
@@ -36,6 +36,7 @@ static int fast = 0;
#define WAV_ID_FMT 0x20746d66 /* "fmt " */
#define WAV_ID_DATA 0x61746164 /* "data" */
#define WAV_ID_PCM 0x0001
+#define WAV_ID_FLOAT_PCM 0x0003
struct WaveHeader
{
@@ -91,6 +92,16 @@ static int init(int rate,int channels,int format,int flags){
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:
@@ -115,7 +126,7 @@ static int init(int rate,int channels,int format,int flags){
wavhdr.wave = le2me_32(WAV_ID_WAVE);
wavhdr.fmt = le2me_32(WAV_ID_FMT);
wavhdr.fmt_length = le2me_32(16);
- wavhdr.fmt_tag = le2me_16(WAV_ID_PCM);
+ wavhdr.fmt_tag = le2me_16(format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM);
wavhdr.channels = le2me_16(ao_data.channels);
wavhdr.sample_rate = le2me_32(ao_data.samplerate);
wavhdr.bytes_per_second = le2me_32(ao_data.bps);