[Mplayer-cvslog] CVS: main/libao2 ao_pcm.c,1.15,1.16

Arpi of Ize arpi at mplayerhq.hu
Tue Feb 4 19:23:06 CET 2003


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv4081

Modified Files:
	ao_pcm.c 
Log Message:
The "initialize wav header with infinite lenght" broke the
post-recording fixup by changing the initialisation value of
data_length.  This fixes it.
based on patch by Olivier Galibert <galibert at pobox.com>


Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ao_pcm.c	2 Feb 2003 16:34:54 -0000	1.15
+++ ao_pcm.c	4 Feb 2003 18:22:43 -0000	1.16
@@ -107,6 +107,9 @@
 	wavhdr.sample_rate = le2me_32(ao_data.samplerate);
 	wavhdr.bytes_per_second = le2me_32(ao_data.bps);
 	wavhdr.bits = le2me_16(bits);
+	
+	wavhdr.data_length=le2me_32(0x7ffff000);
+	wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
 
 	printf("PCM: File: %s (%s)\n"
 	       "PCM: Samplerate: %iHz Channels: %s Format %s\n",
@@ -118,8 +121,10 @@
 
 	fp = fopen(ao_outputfilename, "wb");
 	if(fp) {
-		if(ao_pcm_waveheader) /* Reserve space for wave header */
+		if(ao_pcm_waveheader){ /* Reserve space for wave header */
 			fwrite(&wavhdr,sizeof(wavhdr),1,fp);
+			wavhdr.file_length=wavhdr.data_length=0;
+		}
 		return 1;
 	}
 	printf("PCM: Failed to open %s for writing!\n", ao_outputfilename);



More information about the MPlayer-cvslog mailing list