changeset 4914:de4074ab4e5f

good-looking fix by Tobias Diedrich <td@informatik.uni-hannover.de>
author arpi
date Sat, 02 Mar 2002 18:54:58 +0000
parents 5eb369bc0188
children f6990fad0ab3
files libao2/ao_pcm.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_pcm.c	Sat Mar 02 18:22:44 2002 +0000
+++ b/libao2/ao_pcm.c	Sat Mar 02 18:54:58 2002 +0000
@@ -14,6 +14,8 @@
 
 LIBAO_EXTERN(pcm)
 
+extern int vo_pts;
+
 char *ao_outputfilename = NULL;
 int ao_pcm_waveheader = 1;
 
@@ -82,7 +84,7 @@
 	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 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 @@
 // 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'