ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Fri Mar 31 16:10:12 2017 -0300| [804ae6e30fc7479283b3f2654a4c7cee16932b28] | committer: James Almer
Merge commit 'e5e8a26dcf6d572e841a7a191e4c96524367e3f9' * commit 'e5e8a26dcf6d572e841a7a191e4c96524367e3f9': libxvid: Use proper context in av_log() calls Merged-by: James Almer <jamr...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=804ae6e30fc7479283b3f2654a4c7cee16932b28 --- libavcodec/libxvid_rc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/libxvid_rc.c b/libavcodec/libxvid_rc.c index 0e25a07..076c32c 100644 --- a/libavcodec/libxvid_rc.c +++ b/libavcodec/libxvid_rc.c @@ -48,7 +48,7 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s) 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, "Can't create temporary pass2 file.\n"); return fd; } @@ -69,7 +69,7 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s) 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; @@ -92,7 +92,7 @@ av_cold int ff_xvid_rate_control_init(MpegEncContext *s) if (xvid_plugin_2pass2(NULL, XVID_PLG_CREATE, &xvid_plg_create, &s->rc_context.non_lavc_opaque) < 0) { - av_log(NULL, AV_LOG_ERROR, "xvid_plugin_2pass2 failed\n"); + av_log(s, AV_LOG_ERROR, "xvid_plugin_2pass2 failed\n"); return -1; } return 0; @@ -127,7 +127,7 @@ float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run) xvid_plg_data.type = s->last_pict_type; if (xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_AFTER, &xvid_plg_data, NULL)) { - av_log(s->avctx, AV_LOG_ERROR, + av_log(s, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_AFTER, ...) FAILED\n"); return -1; } @@ -137,7 +137,7 @@ float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run) xvid_plg_data.quant = 0; if (xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_BEFORE, &xvid_plg_data, NULL)) { - av_log(s->avctx, AV_LOG_ERROR, + av_log(s, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_BEFORE, ...) FAILED\n"); return -1; } ====================================================================== diff --cc libavcodec/libxvid_rc.c index 0e25a07,eddbbe8..076c32c --- a/libavcodec/libxvid_rc.c +++ b/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; } @@@ -67,13 -87,7 +67,13 @@@ (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); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog