aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/wildmidi_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-15 18:41:05 +0100
committerMax Kellermann <max@duempel.org>2009-02-15 18:41:05 +0100
commited591f19ef7637a2fa569f5cb7efce5fae7fe2df (patch)
tree267f41ae179ffca99953e941dd9812d16e5b0994 /src/decoder/wildmidi_plugin.c
parent5c68f91daeff90349c3f7d1b759f59f35a78fec9 (diff)
downloadmpd-ed591f19ef7637a2fa569f5cb7efce5fae7fe2df.tar.gz
mpd-ed591f19ef7637a2fa569f5cb7efce5fae7fe2df.tar.xz
mpd-ed591f19ef7637a2fa569f5cb7efce5fae7fe2df.zip
wildmidi: check if configurationn file exists
Don't call WildMidi_Init() if the configuration file does not exist. Don't let libwildmidi clutter stderr with its warning message.
Diffstat (limited to 'src/decoder/wildmidi_plugin.c')
-rw-r--r--src/decoder/wildmidi_plugin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/decoder/wildmidi_plugin.c b/src/decoder/wildmidi_plugin.c
index 5f13e7160..43300e330 100644
--- a/src/decoder/wildmidi_plugin.c
+++ b/src/decoder/wildmidi_plugin.c
@@ -37,6 +37,10 @@ wildmidi_init(const struct config_param *param)
config_file = config_get_block_string(param, "config_file",
"/etc/timidity/timidity.cfg");
+ if (!g_file_test(config_file, G_FILE_TEST_IS_REGULAR)) {
+ g_debug("configuration file does not exist: %s", config_file);
+ return false;
+ }
ret = WildMidi_Init(config_file, WILDMIDI_SAMPLE_RATE, 0);
return ret == 0;