mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-28 06:52:57 +00:00
fix build if ENABLE_MIXER_THREADS == 0
This commit is contained in:
parent
2ad96d020e
commit
354bea9cfc
1 changed files with 12 additions and 9 deletions
|
@ -38,7 +38,7 @@ typedef struct _fluid_mixer_buffers_t fluid_mixer_buffers_t;
|
|||
|
||||
struct _fluid_mixer_buffers_t {
|
||||
fluid_rvoice_mixer_t* mixer; /**< Owner of object */
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
fluid_thread_t* thread; /**< Thread object */
|
||||
#endif
|
||||
|
||||
|
@ -84,7 +84,7 @@ struct _fluid_rvoice_mixer_t {
|
|||
fluid_ladspa_fx_t* ladspa_fx; /**< Used by mixer only: Effects unit for LADSPA support. Never created or freed */
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
// int sleeping_threads; /**< Atomic: number of threads currently asleep */
|
||||
// int active_threads; /**< Atomic: number of threads in the thread loop */
|
||||
fluid_atomic_int_t threads_should_terminate; /**< Atomic: Set to TRUE when threads should terminate */
|
||||
|
@ -99,7 +99,9 @@ struct _fluid_rvoice_mixer_t {
|
|||
#endif
|
||||
};
|
||||
|
||||
#if ENABLE_MIXER_THREADS
|
||||
static void delete_rvoice_mixer_threads(fluid_rvoice_mixer_t* mixer);
|
||||
#endif
|
||||
|
||||
static FLUID_INLINE void
|
||||
fluid_rvoice_mixer_process_fx(fluid_rvoice_mixer_t* mixer)
|
||||
|
@ -277,7 +279,7 @@ fluid_mixer_buffer_process_finished_voices(fluid_mixer_buffers_t* buffers)
|
|||
|
||||
static FLUID_INLINE void fluid_rvoice_mixer_process_finished_voices(fluid_rvoice_mixer_t* mixer)
|
||||
{
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
int i;
|
||||
for (i=0; i < mixer->thread_count; i++)
|
||||
fluid_mixer_buffer_process_finished_voices(&mixer->threads[i]);
|
||||
|
@ -380,7 +382,7 @@ DECLARE_FLUID_RVOICE_FUNCTION(fluid_rvoice_mixer_set_polyphony)
|
|||
== FLUID_FAILED)
|
||||
return /*FLUID_FAILED*/;
|
||||
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < handler->thread_count; i++)
|
||||
|
@ -554,7 +556,7 @@ new_fluid_rvoice_mixer(int buf_count, int fx_buf_count, fluid_real_t sample_rate
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
mixer->thread_ready = new_fluid_cond();
|
||||
mixer->wakeup_threads = new_fluid_cond();
|
||||
mixer->thread_ready_m = new_fluid_cond_mutex();
|
||||
|
@ -618,8 +620,9 @@ void delete_fluid_rvoice_mixer(fluid_rvoice_mixer_t* mixer)
|
|||
{
|
||||
fluid_return_if_fail(mixer != NULL);
|
||||
|
||||
#if ENABLE_MIXER_THREADS
|
||||
delete_rvoice_mixer_threads(mixer);
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
|
||||
if (mixer->thread_ready)
|
||||
delete_fluid_cond(mixer->thread_ready);
|
||||
if (mixer->wakeup_threads)
|
||||
|
@ -751,7 +754,7 @@ int fluid_rvoice_mixer_get_active_voices(fluid_rvoice_mixer_t* mixer)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
|
||||
static FLUID_INLINE fluid_rvoice_t*
|
||||
fluid_mixer_get_mt_rvoice(fluid_rvoice_mixer_t* mixer)
|
||||
|
@ -956,7 +959,7 @@ static void delete_rvoice_mixer_threads(fluid_rvoice_mixer_t* mixer)
|
|||
*/
|
||||
DECLARE_FLUID_RVOICE_FUNCTION(fluid_rvoice_mixer_set_threads)
|
||||
{
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
char name[16];
|
||||
int i;
|
||||
fluid_rvoice_mixer_t* mixer = obj;
|
||||
|
@ -1013,7 +1016,7 @@ fluid_rvoice_mixer_render(fluid_rvoice_mixer_t* mixer, int blockcount)
|
|||
fluid_profile(FLUID_PROF_ONE_BLOCK_CLEAR, prof_ref, mixer->active_voices,
|
||||
mixer->current_blockcount * FLUID_BUFSIZE);
|
||||
|
||||
#ifdef ENABLE_MIXER_THREADS
|
||||
#if ENABLE_MIXER_THREADS
|
||||
if (mixer->thread_count > 0)
|
||||
fluid_render_loop_multithread(mixer);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue