# HG changeset patch # User arpi # Date 1044382963 0 # Node ID d824f1a3c3415d28f811da096b8faacdea1d39b8 # Parent 9fd44bc91631e475a0b700e05d148cb697286606 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 diff -r 9fd44bc91631 -r d824f1a3c341 libao2/ao_pcm.c --- a/libao2/ao_pcm.c Tue Feb 04 17:51:39 2003 +0000 +++ b/libao2/ao_pcm.c Tue Feb 04 18:22:43 2003 +0000 @@ -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);