aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-18 14:40:11 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-06-19 13:27:42 +0200
commit8749b83e0be1b290ae2605f11684d096cc85098f (patch)
treee1ef582b9774de9af41cc612876243fe5940e32b
parenta9b600cf3995bc075090f4f1dbfbf772e21a4d5b (diff)
downloadffmpeg-8749b83e0be1b290ae2605f11684d096cc85098f.tar.gz
avcodec/libx264: Avoid reconfig on equivalent aspect ratios
Workaround for ticket #4287. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 7b1c03aa744f1f82fe30ea2cd2aeef2ea01d5ce9) Conflicts: libavcodec/libx264.c
-rw-r--r--libavcodec/libx264.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9020a40495..d25f69afbb 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);