[Mplayer-cvslog] CVS: main/libao2 ao_pcm.c,1.7,1.8

Alban Bedel CVS albeu at mplayerhq.hu
Sat Jun 22 14:10:09 CEST 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv29010/libao2

Modified Files:
	ao_pcm.c 
Log Message:
Allow writing to pipe.


Index: ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ao_pcm.c	30 May 2002 11:53:51 -0000	1.7
+++ ao_pcm.c	22 Jun 2002 12:10:02 -0000	1.8
@@ -109,7 +109,7 @@
 
 	if(fp) {
 		if(ao_pcm_waveheader) /* Reserve space for wave header */
-			fseek(fp, sizeof(wavhdr), SEEK_SET);
+			fwrite(&wavhdr,sizeof(wavhdr),1,fp);
 		return 1;
 	}
 	printf("PCM: Failed to open %s for writing!\n", ao_outputfilename);
@@ -119,10 +119,9 @@
 // close audio device
 static void uninit(){
 	
-	if(ao_pcm_waveheader){ /* Write wave header */
+	if(ao_pcm_waveheader && fseek(fp, 0, SEEK_SET) == 0){ /* Write wave header */
 		wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
 		wavhdr.file_length = le2me_32(wavhdr.file_length);
-		fseek(fp, 0, SEEK_SET);
 		fwrite(&wavhdr,sizeof(wavhdr),1,fp);
 	}
 	fclose(fp);




More information about the MPlayer-cvslog mailing list