summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-26 13:19:32 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-26 13:19:32 +0000
commit329ba64c0ae0ea857098ade217588285fb6772bd (patch)
treeee49e44ab3bc25ad71e9964dcdf94faa73b4326c /libao2
parenta5ddf3c5316c89ec6757bdc271abec150c02c980 (diff)
downloadmpv-329ba64c0ae0ea857098ade217588285fb6772bd.tar.bz2
mpv-329ba64c0ae0ea857098ade217588285fb6772bd.tar.xz
le2me_32 is no longer a macro on PPC, and in general does not have to
be, thus using it like a constant is incorrect. Move wavhdr initialization to the code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21266 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_pcm.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c
index 249ee5e100..0dbd7bbe0a 100644
--- a/libao2/ao_pcm.c
+++ b/libao2/ao_pcm.c
@@ -53,22 +53,7 @@ struct WaveHeader
};
/* init with default values */
-static struct WaveHeader wavhdr = {
- le2me_32(WAV_ID_RIFF),
- /* same conventions than in sox/wav.c/wavwritehdr() */
- 0, //le2me_32(0x7ffff024),
- le2me_32(WAV_ID_WAVE),
- le2me_32(WAV_ID_FMT),
- le2me_32(16),
- le2me_16(WAV_ID_PCM),
- le2me_16(2),
- le2me_32(44100),
- le2me_32(192000),
- le2me_16(4),
- le2me_16(16),
- le2me_32(WAV_ID_DATA),
- 0, //le2me_32(0x7ffff000)
-};
+static struct WaveHeader wavhdr;
static FILE *fp = NULL;
@@ -121,12 +106,18 @@ static int init(int rate,int channels,int format,int flags){
ao_data.format=format;
ao_data.bps=channels*rate*(bits/8);
+ wavhdr.riff = le2me_32(WAV_ID_RIFF);
+ 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.channels = le2me_16(ao_data.channels);
wavhdr.sample_rate = le2me_32(ao_data.samplerate);
wavhdr.bytes_per_second = le2me_32(ao_data.bps);
wavhdr.bits = le2me_16(bits);
wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8));
+ wavhdr.data = le2me_32(WAV_ID_DATA);
wavhdr.data_length=le2me_32(0x7ffff000);
wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;