Fix libx264 fastfirstpass, move apply_fastfirstpass after user customized options.

This commit is contained in:
Baptiste Coudurier 2011-04-19 15:23:36 -07:00
parent 90a2929416
commit 37c0a443f9
1 changed files with 7 additions and 7 deletions

View File

@ -262,13 +262,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
return -1; return -1;
} }
if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params);
if (x4->profile)
if (x264_param_apply_profile(&x4->params, x4->profile) < 0)
return -1;
x4->params.pf_log = X264_log; x4->params.pf_log = X264_log;
x4->params.p_log_private = avctx; x4->params.p_log_private = avctx;
x4->params.i_log_level = X264_LOG_DEBUG; x4->params.i_log_level = X264_LOG_DEBUG;
@ -302,6 +295,13 @@ static av_cold int X264_init(AVCodecContext *avctx)
(float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size; (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
} }
if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params);
if (x4->profile)
if (x264_param_apply_profile(&x4->params, x4->profile) < 0)
return -1;
x4->params.i_width = avctx->width; x4->params.i_width = avctx->width;
x4->params.i_height = avctx->height; x4->params.i_height = avctx->height;
x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num; x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;