From 67515f39fc7b1bba1e15d065e21ae3ca2ebeba1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 16 May 2008 22:00:49 +0000 Subject: ext/timidity/gstwildmidi.c: Check some more common locations for a valid configuration file. Original commit message from CVS: * ext/timidity/gstwildmidi.c: (wildmidi_open_config): Check some more common locations for a valid configuration file. Fixes bug #533435. Packagers should still #define WILDMIDI_CFG to the distributions default location. --- ext/timidity/gstwildmidi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ext/timidity') diff --git a/ext/timidity/gstwildmidi.c b/ext/timidity/gstwildmidi.c index 66d545f2..1544d1aa 100644 --- a/ext/timidity/gstwildmidi.c +++ b/ext/timidity/gstwildmidi.c @@ -162,6 +162,17 @@ wildmidi_open_config () } } + if (path == NULL) { + path = + g_build_path (G_DIR_SEPARATOR_S, "/etc", "wildmidi", "wildmidi.cfg", + NULL); + GST_DEBUG ("trying %s", path); + if (path && (g_access (path, R_OK) == -1)) { + g_free (path); + path = NULL; + } + } + if (path == NULL) { path = g_strdup (WILDMIDI_CFG); GST_DEBUG ("trying %s", path); @@ -180,6 +191,17 @@ wildmidi_open_config () } } + if (path == NULL) { + path = + g_build_path (G_DIR_SEPARATOR_S, "/etc", "timidity", "timidity.cfg", + NULL); + GST_DEBUG ("trying %s", path); + if (path && (g_access (path, R_OK) == -1)) { + g_free (path); + path = NULL; + } + } + if (path == NULL) { /* I've created a symlink to get it playing * ln -s /usr/share/timidity/timidity.cfg /etc/wildmidi.cfg -- cgit v1.2.1