aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-03-23 19:19:59 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-03-23 19:19:59 +0000
commit3ed4046fadce3efdc53c26e623b3ee6697e3dcdc (patch)
treeaf70cbfe234ac863052859cc0cc9359a425526a2 /libavcodec
parent3e0fdf37456faef105e3aae0a03286e06351a0d2 (diff)
downloadffmpeg-3ed4046fadce3efdc53c26e623b3ee6697e3dcdc.tar.gz
create temporary file in current directory if it failed in /tmp
Originally committed as revision 4075 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/xvidff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/xvidff.c b/libavcodec/xvidff.c
index 70f744f5e8..b46b5e3093 100644
--- a/libavcodec/xvidff.c
+++ b/libavcodec/xvidff.c
@@ -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");