[FFmpeg-cvslog] avcodec/libx264: Avoid reconfig on equivalent aspect ratios

Michael Niedermayer git at videolan.org
Fri Jun 19 13:30:40 CEST 2015


ffmpeg | branch: release/2.7 | Michael Niedermayer <michaelni at gmx.at> | Thu Jun 18 14:40:11 2015 +0200| [8749b83e0be1b290ae2605f11684d096cc85098f] | committer: Carl Eugen Hoyos

avcodec/libx264: Avoid reconfig on equivalent aspect ratios

Workaround for ticket #4287.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7b1c03aa744f1f82fe30ea2cd2aeef2ea01d5ce9)

Conflicts:
	libavcodec/libx264.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8749b83e0be1b290ae2605f11684d096cc85098f
---

 libavcodec/libx264.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9020a40..d25f69a 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -191,8 +191,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
             x4->params.b_tff = frame->top_field_first;
             x264_encoder_reconfig(x4->enc, &x4->params);
         }
-        if (x4->params.vui.i_sar_height != ctx->sample_aspect_ratio.den ||
-            x4->params.vui.i_sar_width  != ctx->sample_aspect_ratio.num) {
+        if (x4->params.vui.i_sar_height*ctx->sample_aspect_ratio.num != ctx->sample_aspect_ratio.den * x4->params.vui.i_sar_width) {
             x4->params.vui.i_sar_height = ctx->sample_aspect_ratio.den;
             x4->params.vui.i_sar_width  = ctx->sample_aspect_ratio.num;
             x264_encoder_reconfig(x4->enc, &x4->params);



More information about the ffmpeg-cvslog mailing list