From 94c6342759b74d9e4b272f899c72f4c5658d736d Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 7 Jun 2002 22:40:06 +0000 Subject: mencoder out-of-diskspace error handling, patch by Eric Lammerts git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6334 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index d9717afcdd..adea9e09f8 100644 --- a/mencoder.c +++ b/mencoder.c @@ -1100,6 +1100,10 @@ if(sh_audio && !demuxer2){ } #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 @@ muxer_f_size=ftello(muxer_f); 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)); -- cgit v1.2.3