]> git.sesse.net Git - x264/commitdiff
fix parsing of --deblock %d,%d (beta was ignored)
authorLoren Merritt <pengvado@videolan.org>
Mon, 30 Oct 2006 00:09:21 +0000 (00:09 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 30 Oct 2006 00:09:21 +0000 (00:09 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@597 df754926-b1dd-0310-bc7b-ec298dee348c

common/common.c

index 6b16e0bcd4eae94db5ba4562baf82e086e989bdc..4bc8fc099fad7294917375e9b2a692085480bbdb 100644 (file)
@@ -313,13 +313,15 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
         p->b_deblocking_filter = !atobool(value);
     OPT2("filter", "deblock")
     {
-        int count;
-        if( 0 < (count = sscanf( value, "%d:%d", &p->i_deblocking_filter_alphac0, &p->i_deblocking_filter_beta )) ||
-            0 < (count = sscanf( value, "%d,%d", &p->i_deblocking_filter_alphac0, &p->i_deblocking_filter_beta )) )
+        if( 2 == sscanf( value, "%d:%d", &p->i_deblocking_filter_alphac0, &p->i_deblocking_filter_beta ) ||
+            2 == sscanf( value, "%d,%d", &p->i_deblocking_filter_alphac0, &p->i_deblocking_filter_beta ) )
         {
             p->b_deblocking_filter = 1;
-            if( count == 1 )
-                p->i_deblocking_filter_beta = p->i_deblocking_filter_alphac0;
+        }
+        else if( sscanf( value, "%d", &p->i_deblocking_filter_alphac0 ) )
+        {
+            p->b_deblocking_filter = 1;
+            p->i_deblocking_filter_beta = p->i_deblocking_filter_alphac0;
         }
         else
             p->b_deblocking_filter = atobool(value);