aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 90fb50d3..4fdd1261 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -30,13 +30,6 @@
#include "alu.h"
-typedef struct ALmodulatorStateFactory {
- DERIVE_FROM_TYPE(ALeffectStateFactory);
-} ALmodulatorStateFactory;
-
-static ALmodulatorStateFactory ModulatorFactory;
-
-
typedef struct ALmodulatorState {
DERIVE_FROM_TYPE(ALeffectState);
@@ -187,6 +180,10 @@ static void ALmodulatorState_Delete(ALmodulatorState *state)
DEFINE_ALEFFECTSTATE_VTABLE(ALmodulatorState);
+typedef struct ALmodulatorStateFactory {
+ DERIVE_FROM_TYPE(ALeffectStateFactory);
+} ALmodulatorStateFactory;
+
static ALeffectState *ALmodulatorStateFactory_create(ALmodulatorStateFactory *UNUSED(factory))
{
ALmodulatorState *state;
@@ -205,16 +202,10 @@ static ALeffectState *ALmodulatorStateFactory_create(ALmodulatorStateFactory *UN
DEFINE_ALEFFECTSTATEFACTORY_VTABLE(ALmodulatorStateFactory);
-
-static void init_modulator_factory(void)
-{
- SET_VTABLE2(ALmodulatorStateFactory, ALeffectStateFactory, &ModulatorFactory);
-}
-
ALeffectStateFactory *ALmodulatorStateFactory_getFactory(void)
{
- static pthread_once_t once = PTHREAD_ONCE_INIT;
- pthread_once(&once, init_modulator_factory);
+ static ALmodulatorStateFactory ModulatorFactory = { { GET_VTABLE2(ALmodulatorStateFactory, ALeffectStateFactory) } };
+
return STATIC_CAST(ALeffectStateFactory, &ModulatorFactory);
}