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);