OSDN Git Service

Merge commit 'e5e8a26dcf6d572e841a7a191e4c96524367e3f9'
authorJames Almer <jamrial@gmail.com>
Fri, 31 Mar 2017 19:10:12 +0000 (16:10 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 31 Mar 2017 19:10:32 +0000 (16:10 -0300)
* commit 'e5e8a26dcf6d572e841a7a191e4c96524367e3f9':
  libxvid: Use proper context in av_log() calls

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/libxvid_rc.c

@@@ -46,9 -66,9 +46,9 @@@ av_cold int ff_xvid_rate_control_init(M
      xvid_plg_create_t xvid_plg_create = { 0 };
      xvid_plugin_2pass2_t xvid_2pass2  = { 0 };
  
 -    fd = ff_tempfile("xvidrc.", &tmp_name);
 +    fd = avpriv_tempfile("xvidrc.", &tmp_name, 0, s->avctx);
      if (fd < 0) {
-         av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
 -        av_log(s, AV_LOG_ERROR, "Cannot create temporary pass2 file.\n");
++        av_log(s, AV_LOG_ERROR, "Can't create temporary pass2 file.\n");
          return fd;
      }
  
                   (rce->i_tex_bits + rce->p_tex_bits + rce->misc_bits + 7) / 8,
                   (rce->header_bits + rce->mv_bits + 7) / 8);
  
 -        write(fd, tmp, strlen(tmp));
 +        if (write(fd, tmp, strlen(tmp)) < 0) {
 +            int ret = AVERROR(errno);
-             av_log(NULL, AV_LOG_ERROR, "Error %s writing 2pass logfile\n", av_err2str(ret));
++            av_log(s, AV_LOG_ERROR, "Error %s writing 2pass logfile\n", av_err2str(ret));
 +            av_free(tmp_name);
 +            close(fd);
 +            return ret;
 +        }
      }
  
      close(fd);