Mercurial > libavcodec.hg
comparison xvidff.c @ 2574:9973475ccf1e libavcodec
create temporary file in current directory if it failed in /tmp
author | michael |
---|---|
date | Wed, 23 Mar 2005 19:19:59 +0000 |
parents | 0fcee7879d3f |
children | ef44d24680d1 |
comparison
equal
deleted
inserted
replaced
2573:c0ce123ef11c | 2574:9973475ccf1e |
---|---|
232 "XviD: Cannot allocate 2-pass buffer\n"); | 232 "XviD: Cannot allocate 2-pass buffer\n"); |
233 return -1; | 233 return -1; |
234 } | 234 } |
235 strcpy(x->twopassfile, "/tmp/xvidff.XXXXXX"); | 235 strcpy(x->twopassfile, "/tmp/xvidff.XXXXXX"); |
236 fd = mkstemp(x->twopassfile); | 236 fd = mkstemp(x->twopassfile); |
237 if(fd < 0){ | |
238 strcpy(x->twopassfile, "./xvidff.XXXXXX"); | |
239 fd = mkstemp(x->twopassfile); | |
240 } | |
237 if( fd == -1 ) { | 241 if( fd == -1 ) { |
238 av_log(avctx, AV_LOG_ERROR, | 242 av_log(avctx, AV_LOG_ERROR, |
239 "XviD: Cannot write 2-pass pipe\n"); | 243 "XviD: Cannot write 2-pass pipe\n"); |
240 return -1; | 244 return -1; |
241 } | 245 } |