[Transform/Dimchg] Refine option string parsing code
authorWook Song <wook16.song@samsung.com>
Tue, 12 Feb 2019 07:27:06 +0000 (16:27 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 15 Feb 2019 06:20:04 +0000 (15:20 +0900)
This patch refines the code for parsing option string of the dimchg mode.

Signed-off-by: Wook Song <wook16.song@samsung.com>
gst/nnstreamer/tensor_transform/tensor_transform.c

index e0035af..d9d4fee 100644 (file)
@@ -726,7 +726,6 @@ gst_tensor_transform_set_option_data (GstTensorTransform * filter)
   switch (filter->mode) {
     case GTT_DIMCHG:
     {
-      int a, b;
       gchar **strv = NULL;
 
       if (!g_regex_match_simple (REGEX_DIMCHG_OPTION, filter->option, 0, 0)) {
@@ -740,18 +739,8 @@ gst_tensor_transform_set_option_data (GstTensorTransform * filter)
 
       strv = g_strsplit (filter->option, ":", 2);
 
-      if (strv[0] != NULL)
-        a = g_ascii_strtoull (strv[0], NULL, 10);
-      else
-        a = 0;
-
-      if (strv[1] != NULL)
-        b = g_ascii_strtoull (strv[1], NULL, 10);
-      else
-        b = 0;
-
-      filter->data_dimchg.from = a;
-      filter->data_dimchg.to = b;
+      filter->data_dimchg.from = g_ascii_strtoull (strv[0], NULL, 10);
+      filter->data_dimchg.to = g_ascii_strtoull (strv[1], NULL, 10);
       filter->loaded = TRUE;
       g_strfreev (strv);
       break;