[MPlayer-cvslog] r21266 - trunk/libao2/ao_pcm.c

reimar subversion at mplayerhq.hu
Sun Nov 26 14:19:32 CET 2006


Author: reimar
Date: Sun Nov 26 14:19:32 2006
New Revision: 21266

Modified:
   trunk/libao2/ao_pcm.c

Log:
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.


Modified: trunk/libao2/ao_pcm.c
==============================================================================
--- trunk/libao2/ao_pcm.c	(original)
+++ trunk/libao2/ao_pcm.c	Sun Nov 26 14:19:32 2006
@@ -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;
 



More information about the MPlayer-cvslog mailing list