From 5c2f94c8bfa7b98b3c832d0ce11c6ecdbd474029 Mon Sep 17 00:00:00 2001 From: waker Date: Thu, 31 Mar 2011 22:06:22 +0200 Subject: thread-safe config access --- plugins/sndfile/sndfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/sndfile') 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; } -- cgit v1.2.3