Merge pull request #229 from FluidSynth/fluid-exec

minor fixes for fluidsynth.c
This commit is contained in:
Tom M 2017-10-06 13:08:51 +02:00 committed by GitHub
commit 87fdc38264
3 changed files with 19 additions and 27 deletions

View file

@ -554,7 +554,7 @@ fluid_jack_driver_process (jack_nframes_t nframes, void *arg)
}
}
audio_driver = client->audio_driver;
audio_driver = fluid_atomic_pointer_get (&client->audio_driver);
if (!audio_driver) return 0;
if (audio_driver->callback != NULL)

View file

@ -42,10 +42,6 @@
#include "config_win32.h"
#endif
#ifdef HAVE_SIGNAL_H
#include "signal.h"
#endif
#include "fluid_lash.h"
#ifndef WITH_MIDI
@ -263,16 +259,6 @@ fast_render_loop(fluid_settings_t* settings, fluid_synth_t* synth, fluid_player_
delete_fluid_file_renderer(renderer);
}
#ifdef HAVE_SIGNAL_H
/*
* handle_signal
*/
void handle_signal(int sig_num)
{
}
#endif
/*
* main
*/
@ -589,14 +575,18 @@ int main(int argc, char** argv)
}
#endif
/* The 'groups' setting is only relevant for LADSPA operation
/* The 'groups' setting is relevant for LADSPA operation and channel mapping
* in rvoice_mixer.
* If not given, set number groups to number of audio channels, because
* they are the same (there is nothing between synth output and 'sound card')
*/
if ((audio_groups == 0) && (audio_channels != 0)) {
audio_groups = audio_channels;
}
fluid_settings_setint(settings, "synth.audio-groups", audio_groups);
if (audio_groups != 0)
{
fluid_settings_setint(settings, "synth.audio-groups", audio_groups);
}
if (fast_render) {
midi_in = 0;
@ -632,10 +622,6 @@ int main(int argc, char** argv)
argv[i]);
}
#ifdef HAVE_SIGNAL_H
/* signal(SIGINT, handle_signal); */
#endif
/* start the synthesis thread */
if (!fast_render) {
adriver = new_fluid_audio_driver(settings, synth);
@ -682,9 +668,9 @@ int main(int argc, char** argv)
/* run commands specified in config file */
if (config_file != NULL) {
fluid_source(cmd_handler, config_file);
} else if (fluid_get_userconf(buf, 512) != NULL) {
} else if (fluid_get_userconf(buf, sizeof(buf)*sizeof(buf[0])) != NULL) {
fluid_source(cmd_handler, buf);
} else if (fluid_get_sysconf(buf, 512) != NULL) {
} else if (fluid_get_sysconf(buf, sizeof(buf)*sizeof(buf[0])) != NULL) {
fluid_source(cmd_handler, buf);
}

View file

@ -1098,8 +1098,11 @@ fluid_settings_setnum(fluid_settings_t* settings, const char *name, double val)
if (node->type == FLUID_NUM_TYPE) {
fluid_num_setting_t* setting = &node->num;
if (val < setting->min) val = setting->min;
else if (val > setting->max) val = setting->max;
if (val < setting->min || val > setting->max)
{
FLUID_LOG(FLUID_DBG, "requested set value for %s out of range", name);
return retval;
}
setting->value = val;
@ -1247,8 +1250,11 @@ fluid_settings_setint(fluid_settings_t* settings, const char *name, int val)
if (node->type == FLUID_INT_TYPE) {
fluid_int_setting_t* setting = &node->i;
if (val < setting->min) val = setting->min;
else if (val > setting->max) val = setting->max;
if (val < setting->min || val > setting->max)
{
FLUID_LOG(FLUID_DBG, "requested set value for %s out of range", name);
return retval;
}
setting->value = val;