gboolean
nnsconf_loadconf (gboolean force_reload)
{
+ const gchar root_path_prefix[] = NNSTREAMER_SYS_ROOT_PATH_PREFIX;
g_autoptr (GKeyFile) key_file = NULL;
guint i;
}
/* Read from the conf file first */
- conf.conffile = g_strdup (NNSTREAMER_CONF_FILE);
+ if (g_path_is_absolute (NNSTREAMER_CONF_FILE)) {
+ conf.conffile = g_strdup (NNSTREAMER_CONF_FILE);
+ } else {
+ /** default value of 'sysconfdir' in meson is 'etc' */
+ conf.conffile = g_build_path (G_DIR_SEPARATOR_S, root_path_prefix,
+ NNSTREAMER_CONF_FILE, NULL);
+ }
+
if (!g_file_test (conf.conffile, G_FILE_TEST_IS_REGULAR)) {
/* File not found or not configured */
g_free (conf.conffile);
#include <glib.h>
G_BEGIN_DECLS
+/* Hard-coded system-dependent root path prefix */
+#ifdef G_OS_WIN32
+#define NNSTREAMER_SYS_ROOT_PATH_PREFIX "c:\\"
+#else
+#define NNSTREAMER_SYS_ROOT_PATH_PREFIX "/"
+#endif /* G_OS_WIN32 */
+
/* Env-var names */
#define NNSTREAMER_ENVVAR_CONF_FILE "NNSTREAMER_CONF"
#define NNSTREAMER_ENVVAR_FILTERS "NNSTREAMER_FILTERS"