-void _media_util_trim_path(const char *input_path, char **output_path)
-{
- gchar **name_list = NULL;
- gchar *tmp_path = NULL;
-
- if (!STRING_VALID(input_path) || output_path == NULL)
- return;
-
- /* Workflow example
- Input : /a/b//c/
- After g_strsplit() : {'','a','b','','c',''}
- After g_build_pathv() : a/b/c
- After g_strdup_printf() : /a/b/c
- */
- name_list = g_strsplit(input_path, "/", -1);
- if (!name_list)
- return;
-
- tmp_path = g_build_pathv(G_DIR_SEPARATOR_S, name_list);
- g_strfreev(name_list);
- if (!tmp_path)
- return;
-
- /* g_build_pathv does not add root '/' */
- *output_path = g_strdup_printf("/%s", tmp_path);
- g_free(tmp_path);
-}
-
-