diff options
author | waker <wakeroid@gmail.com> | 2011-03-31 22:06:22 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-03-31 22:06:22 +0200 |
commit | 5c2f94c8bfa7b98b3c832d0ce11c6ecdbd474029 (patch) | |
tree | eb92ff856f530485809ee0e2e0710f56f8d0155b /plugins/sndfile | |
parent | 57de90e3b8958b4d5edf1bd0145f98623768caa9 (diff) |
thread-safe config access
Diffstat (limited to 'plugins/sndfile')
-rw-r--r-- | plugins/sndfile/sndfile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index 1117788e..3af4616f 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -379,13 +379,14 @@ static const char *filetypes[] = { "WAV", NULL }; static void sndfile_init_exts (void) { - const char *new_exts = deadbeef->conf_get_str ("sndfile.extensions", DEFAULT_EXTS); for (int i = 0; exts[i]; i++) { free (exts[i]); } exts[0] = NULL; int n = 0; + deadbeef->conf_lock (); + const char *new_exts = deadbeef->conf_get_str_fast ("sndfile.extensions", DEFAULT_EXTS); while (*new_exts) { if (n >= EXT_MAX) { fprintf (stderr, "sndfile: too many extensions, max is %d\n", EXT_MAX); @@ -406,6 +407,7 @@ sndfile_init_exts (void) { } new_exts = e+1; } + deadbeef->conf_unlock (); exts[n] = NULL; } |