aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJULIAN GARDNER <joolzg@btinternet.com>2012-07-08 17:33:47 +0300
committerAnton Khirnov <anton@khirnov.net>2012-07-09 08:15:59 +0200
commit0dd283faca34f25bc96bfe75392b75b8efb7de8d (patch)
tree69480f4813e5a8a31a0ca32a3ae29ea9aa828f1b /libavcodec
parent5b7a88f0ba160ce9ba9f625dd1a777a66244c089 (diff)
downloadffmpeg-0dd283faca34f25bc96bfe75392b75b8efb7de8d.tar.gz
libx264: support aspect ratio switching
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libx264.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 35c003050f..adda8817ec 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -148,6 +148,12 @@ 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) {
+ 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);
+ }
}
do {