diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-02-04 18:22:43 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-02-04 18:22:43 +0000 |
commit | 7a35f528d1452786abd111e0e23268dc5feb621c (patch) | |
tree | ec67e3cb72b4a29dcbf54c181f250958d890e405 | |
parent | 409f2f0ada8b845299351016caf2f6713115eb4f (diff) | |
download | mpv-7a35f528d1452786abd111e0e23268dc5feb621c.tar.bz2 mpv-7a35f528d1452786abd111e0e23268dc5feb621c.tar.xz |
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@pobox.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9278 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_pcm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index 46080f0b00..d8d234152e 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -107,6 +107,9 @@ static int init(int rate,int channels,int format,int flags){ 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 @@ static int init(int rate,int channels,int format,int flags){ 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); |