[FFmpeg-cvslog] libx264: support aspect ratio switching

JULIAN GARDNER git at videolan.org
Mon Jul 9 22:43:08 CEST 2012


ffmpeg | branch: master | JULIAN GARDNER <joolzg at btinternet.com> | Sun Jul  8 17:33:47 2012 +0300| [0dd283faca34f25bc96bfe75392b75b8efb7de8d] | committer: Anton Khirnov

libx264: support aspect ratio switching

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/libx264.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 35c0030..adda881 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 {



More information about the ffmpeg-cvslog mailing list