mirror of
https://github.com/mpv-player/mpv
synced 2024-09-05 02:48:21 +02:00
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
This commit is contained in:
parent
409f2f0ada
commit
7a35f528d1
@ -108,6 +108,9 @@ static int init(int rate,int channels,int format,int flags){
|
|||||||
wavhdr.bytes_per_second = le2me_32(ao_data.bps);
|
wavhdr.bytes_per_second = le2me_32(ao_data.bps);
|
||||||
wavhdr.bits = le2me_16(bits);
|
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"
|
printf("PCM: File: %s (%s)\n"
|
||||||
"PCM: Samplerate: %iHz Channels: %s Format %s\n",
|
"PCM: Samplerate: %iHz Channels: %s Format %s\n",
|
||||||
ao_outputfilename, (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
|
ao_outputfilename, (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
|
||||||
@ -118,8 +121,10 @@ static int init(int rate,int channels,int format,int flags){
|
|||||||
|
|
||||||
fp = fopen(ao_outputfilename, "wb");
|
fp = fopen(ao_outputfilename, "wb");
|
||||||
if(fp) {
|
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);
|
fwrite(&wavhdr,sizeof(wavhdr),1,fp);
|
||||||
|
wavhdr.file_length=wavhdr.data_length=0;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
printf("PCM: Failed to open %s for writing!\n", ao_outputfilename);
|
printf("PCM: Failed to open %s for writing!\n", ao_outputfilename);
|
||||||
|
Loading…
Reference in New Issue
Block a user