diff options
author | Felipe Contreras <felipe.contreras@nokia.com> | 2010-03-08 21:53:18 +0200 |
---|---|---|
committer | Felipe Contreras <felipe.contreras@nokia.com> | 2010-03-08 21:53:18 +0200 |
commit | b9b77f2a53f3081effa780fffbcfb50fe00309ab (patch) | |
tree | 2026e8b301ebb1231c1f0ee9a0c37d18fba3a6cd | |
parent | 6680bcdd8bf1fd100b2a7a2df809b4a27fcc9a72 (diff) |
plugin: reorganize code into get_config_path()
Will be useful in next commits to extend to more config options.
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
-rw-r--r-- | omx/gstomx.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c index cc8f3f8..cb26eef 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -105,6 +105,22 @@ static GType (*get_type[]) (void) = { gst_omx_volume_get_type, }; +static gchar * +get_config_path (void) +{ + gchar *path; + const gchar *const *dirs; + int i; + + path = g_strdup (g_getenv ("OMX_CONFIG")); + + if (path) + return path; + + return g_build_filename (g_get_user_config_dir (), + "gst-openmax.conf", NULL); +} + /** * @todo find a way to call plugin_init() when the config file changes * @todo support a system-wide config file @@ -123,12 +139,7 @@ get_element_table (void) gchar *config, *s; GstStructure *element; - path = g_strdup (g_getenv ("OMX_CONFIG")); - if (!path) - { - path = g_build_filename (g_get_user_config_dir (), - "gst-openmax.conf", NULL); - } + path = get_config_path (); if (!g_file_get_contents (path, &config, NULL, NULL)) { |