[Mplayer-cvslog] CVS: main mencoder.c,1.131,1.132

Arpi of Ize arpi at mplayerhq.hu
Sat Jun 8 00:40:09 CEST 2002


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

Modified Files:
	mencoder.c 
Log Message:
mencoder out-of-diskspace error handling, patch by Eric Lammerts <eric at lammerts.org>


Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -r1.131 -r1.132
--- mencoder.c	2 Jun 2002 15:25:52 -0000	1.131
+++ mencoder.c	7 Jun 2002 22:40:06 -0000	1.132
@@ -1100,6 +1100,10 @@
  }
 #endif
 
+ if(ferror(muxer_f)) {
+     mp_msg(MSGT_MENCODER,MSGL_FATAL,"%s: error writing file.\n", out_filename);
+     mencoder_exit(1, NULL);
+ }
 
 } // while(!eof)
 
@@ -1124,7 +1128,10 @@
 printf("Fixup AVI header...\n");
 fseek(muxer_f,0,SEEK_SET);
 aviwrite_write_header(muxer,muxer_f); // update header
-fclose(muxer_f);
+if(ferror(muxer_f) || fclose(muxer_f) != 0) {
+    mp_msg(MSGT_MENCODER,MSGL_FATAL,"%s: error writing file.\n", out_filename);
+    mencoder_exit(1, NULL);
+}
 
 if(out_video_codec==VCODEC_FRAMENO && mux_v->timer>100){
     printf("Recommended video bitrate for 650MB CD: %d\n",(int)((650*1024*1024-muxer_f_size)/mux_v->timer/125));




More information about the MPlayer-cvslog mailing list