From 3d61c6346f0739823f03664611559bf367d5c05b Mon Sep 17 00:00:00 2001 From: arpi Date: Sat, 2 Mar 2002 18:54:58 +0000 Subject: good-looking fix by Tobias Diedrich git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4915 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_pcm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libao2/ao_pcm.c') diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index 6f6179c5fc..ebf697c4f1 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -14,6 +14,8 @@ static ao_info_t info = LIBAO_EXTERN(pcm) +extern int vo_pts; + char *ao_outputfilename = NULL; int ao_pcm_waveheader = 1; @@ -82,7 +84,7 @@ static int init(int rate,int channels,int format,int flags){ printf("PCM: Info - to write WAVE files use -waveheader (default), for RAW PCM -nowaveheader.\n"); fp = fopen(ao_outputfilename, "wb"); - ao_data.outburst = 4096; + ao_data.outburst = 65536; if(fp) { @@ -98,7 +100,7 @@ static int init(int rate,int channels,int format,int flags){ static void uninit(){ if(ao_pcm_waveheader){ /* Write wave header */ - wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr); + wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; fseek(fp, 0, SEEK_SET); fwrite(&wavhdr,sizeof(wavhdr),1,fp); } @@ -126,7 +128,7 @@ static void audio_resume() // return: how many bytes can be played without blocking static int get_space(){ - return ao_data.outburst; + return ao_data.pts < vo_pts ? ao_data.outburst : 0; } // plays 'len' bytes of 'data' -- cgit v1.2.3