aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-07 22:40:06 +0000
committerGravatar arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-06-07 22:40:06 +0000
commit94c6342759b74d9e4b272f899c72f4c5658d736d (patch)
treeff470669e55c5595e3515e33cd9795782fbca679
parentca36c00e525c51f1c632219ec76bb2b39f380ace (diff)
mencoder out-of-diskspace error handling, patch by Eric Lammerts <eric@lammerts.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6334 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--mencoder.c9
1 files changed, 8 insertions, 1 deletions
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));