Revision 1005f542 libavcodec/xvid_rc.c

View differences:

libavcodec/xvid_rc.c
21 21
#include <xvid.h>
22 22
#include <unistd.h>
23 23
#include "avcodec.h"
24
#include "internal.h"
24 25
//#include "dsputil.h"
25 26
#include "mpegvideo.h"
26 27

  
......
37 38

  
38 39
//xvid_debug=-1;
39 40

  
40
    tmp_name= av_strdup("/tmp/xvidrc.XXXXXX");
41
    fd = mkstemp(tmp_name);
42
    if(fd < 0){
43
        strcpy(tmp_name, "./xvidrc.XXXXXX");
44
        fd = mkstemp(tmp_name);
41
    fd=av_tempfile("xvidrc.", &tmp_name);
42
    if (fd == -1) {
43
        av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
44
        return -1;
45 45
    }
46 46

  
47 47
    for(i=0; i<s->rc_context.num_entries; i++){

Also available in: Unified diff