Browse Source

avcodec/libx264: move where x264opts is applied down so it isnt overridden by avctx & defaults

fixes x264opts opengop=1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 12 years ago
parent
commit
64b79141bd
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      libavcodec/libx264.c

+ 13
- 13
libavcodec/libx264.c View File

@@ -394,19 +394,6 @@ static av_cold int X264_init(AVCodecContext *avctx)


OPT_STR("level", x4->level); OPT_STR("level", x4->level);


if(x4->x264opts){
const char *p= x4->x264opts;
while(p){
char param[256]={0}, val[256]={0};
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
OPT_STR(param, "1");
}else
OPT_STR(param, val);
p= strchr(p, ':');
p+=!!p;
}
}

if (avctx->i_quant_factor > 0) if (avctx->i_quant_factor > 0)
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor); x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);


@@ -592,6 +579,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0; x4->params.b_repeat_headers = 0;


if(x4->x264opts){
const char *p= x4->x264opts;
while(p){
char param[256]={0}, val[256]={0};
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
OPT_STR(param, "1");
}else
OPT_STR(param, val);
p= strchr(p, ':');
p+=!!p;
}
}

if (x4->x264_params) { if (x4->x264_params) {
AVDictionary *dict = NULL; AVDictionary *dict = NULL;
AVDictionaryEntry *en = NULL; AVDictionaryEntry *en = NULL;


Loading…
Cancel
Save