Browse code

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>
(cherry picked from commit 64b79141bdfdffaa9fda69eecce140473d0a9a18)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/03/28 08:03:38
Showing 1 changed files
... ...
@@ -391,19 +391,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
391 391
 
392 392
     OPT_STR("level", x4->level);
393 393
 
394
-    if(x4->x264opts){
395
-        const char *p= x4->x264opts;
396
-        while(p){
397
-            char param[256]={0}, val[256]={0};
398
-            if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
399
-                OPT_STR(param, "1");
400
-            }else
401
-                OPT_STR(param, val);
402
-            p= strchr(p, ':');
403
-            p+=!!p;
404
-        }
405
-    }
406
-
407 394
     if (avctx->i_quant_factor > 0)
408 395
         x4->params.rc.f_ip_factor         = 1 / fabs(avctx->i_quant_factor);
409 396
 
... ...
@@ -589,6 +576,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
589 589
     if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
590 590
         x4->params.b_repeat_headers = 0;
591 591
 
592
+    if(x4->x264opts){
593
+        const char *p= x4->x264opts;
594
+        while(p){
595
+            char param[256]={0}, val[256]={0};
596
+            if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
597
+                OPT_STR(param, "1");
598
+            }else
599
+                OPT_STR(param, val);
600
+            p= strchr(p, ':');
601
+            p+=!!p;
602
+        }
603
+    }
604
+
592 605
     if (x4->x264_params) {
593 606
         AVDictionary *dict    = NULL;
594 607
         AVDictionaryEntry *en = NULL;