[Fix] Skip duplicated paths from multiple conf sources
authorDongju Chae <dongju.chae@samsung.com>
Thu, 23 Jan 2020 08:16:07 +0000 (17:16 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 4 Feb 2020 09:29:39 +0000 (01:29 -0800)
This commit skips duplicated paths from multiple conf sources.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
gst/nnstreamer/nnstreamer_conf.c

index f73d6dc..ad4f25c 100644 (file)
@@ -254,12 +254,19 @@ _fill_in_vstr (gchar *** fullpath_vstr, gchar *** basename_vstr,
 {
   GSList *lstF = NULL, *lstB = NULL;
   vstr_helper vstrF, vstrB;
-  guint i, counter;
+  guint i, j, counter;
 
   counter = 0;
   for (i = 0; i < CONF_SOURCE_END; i++) {
     if (searchpath[i]) {
-      _get_filenames (type, searchpath[i], &lstF, &lstB, &counter);
+      /* skip duplicated paths */
+      for (j = i + 1; j < CONF_SOURCE_END; j++) {
+        if (searchpath[j] && !g_strcmp0 (searchpath[i], searchpath[j])) {
+          break;
+        }
+      }
+      if (j == CONF_SOURCE_END)
+        _get_filenames (type, searchpath[i], &lstF, &lstB, &counter);
     }
   }