From 329ba64c0ae0ea857098ade217588285fb6772bd Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 26 Nov 2006 13:19:32 +0000 Subject: 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 --- libao2/ao_pcm.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'libao2/ao_pcm.c') 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; -- cgit v1.2.3