summaryrefslogtreecommitdiff
path: root/libavcodec/xvid_rc.c
diff options
context:
space:
mode:
authorCorey Hickey <bugfood-ml@fatooh.org>2006-03-30 04:33:05 +0000
committerCorey Hickey <bugfood-ml@fatooh.org>2006-03-30 04:33:05 +0000
commit1005f542b20cb152514c9496689148fc4456f438 (patch)
treeff65aadb3a063f6a1cd0f72c2bd4f3a38afc1bae /libavcodec/xvid_rc.c
parent06ab9cffb25518030a1434da5958a5c07f4a7cd3 (diff)
- Add new file internal.h for common internal-use-only functions.
- Add new function av_tempfile() for creating temporary files; contains workaround for MinGW. - Make XviD stuff use av_tempfile(). Originally committed as revision 5245 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xvid_rc.c')
-rw-r--r--libavcodec/xvid_rc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/xvid_rc.c b/libavcodec/xvid_rc.c
index 829ad8e5bf..ed9bec39cb 100644
--- a/libavcodec/xvid_rc.c
+++ b/libavcodec/xvid_rc.c
@@ -21,6 +21,7 @@
#include <xvid.h>
#include <unistd.h>
#include "avcodec.h"
+#include "internal.h"
//#include "dsputil.h"
#include "mpegvideo.h"
@@ -37,11 +38,10 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
//xvid_debug=-1;
- tmp_name= av_strdup("/tmp/xvidrc.XXXXXX");
- fd = mkstemp(tmp_name);
- if(fd < 0){
- strcpy(tmp_name, "./xvidrc.XXXXXX");
- fd = mkstemp(tmp_name);
+ fd=av_tempfile("xvidrc.", &tmp_name);
+ if (fd == -1) {
+ av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
+ return -1;
}
for(i=0; i<s->rc_context.num_entries; i++){