Browse Source

create temporary file in current directory if it failed in /tmp

Originally committed as revision 4075 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 20 years ago
parent
commit
3ed4046fad
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/xvidff.c

+ 4
- 0
libavcodec/xvidff.c View File

@@ -234,6 +234,10 @@ int ff_xvid_encode_init(AVCodecContext *avctx) {
}
strcpy(x->twopassfile, "/tmp/xvidff.XXXXXX");
fd = mkstemp(x->twopassfile);
if(fd < 0){
strcpy(x->twopassfile, "./xvidff.XXXXXX");
fd = mkstemp(x->twopassfile);
}
if( fd == -1 ) {
av_log(avctx, AV_LOG_ERROR,
"XviD: Cannot write 2-pass pipe\n");


Loading…
Cancel
Save