]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libx264.c
fft: rename "z" to "zc" to prevent name collision.
[ffmpeg] / libavcodec / libx264.c
index fdde6309911666890e53ef7fd83be2db6e4e8635..adda8817ece348e29f37dd32507bcc4776156d7b 100644 (file)
@@ -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 {
@@ -546,16 +552,16 @@ static const AVCodecDefault x264_defaults[] = {
 };
 
 AVCodec ff_libx264_encoder = {
-    .name           = "libx264",
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_H264,
-    .priv_data_size = sizeof(X264Context),
-    .init           = X264_init,
-    .encode2        = X264_frame,
-    .close          = X264_close,
-    .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
-    .long_name      = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
-    .priv_class     = &class,
-    .defaults       = x264_defaults,
+    .name             = "libx264",
+    .type             = AVMEDIA_TYPE_VIDEO,
+    .id               = CODEC_ID_H264,
+    .priv_data_size   = sizeof(X264Context),
+    .init             = X264_init,
+    .encode2          = X264_frame,
+    .close            = X264_close,
+    .capabilities     = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
+    .long_name        = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
+    .priv_class       = &class,
+    .defaults         = x264_defaults,
     .init_static_data = X264_init_static,
 };