changeset 21250:7b1ab00ef2eb

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.
author reimar
date Sun, 26 Nov 2006 13:19:32 +0000
parents e181136346c8
children 5f6002214861
files libao2/ao_pcm.c
diffstat 1 files changed, 7 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_pcm.c	Sun Nov 26 13:17:50 2006 +0000
+++ b/libao2/ao_pcm.c	Sun Nov 26 13:19:32 2006 +0000
@@ -53,22 +53,7 @@
 };
 
 /* 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 @@
 	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;