Remove unnecessary fluid_sample_t::valid flag

This commit is contained in:
Marcus Weseloh 2018-04-04 11:03:47 +02:00
parent 963a5e98b4
commit 76102f2009
4 changed files with 4 additions and 9 deletions

View file

@ -1863,7 +1863,5 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
fluid_sample_sanitize_loop(sample, sfont->samplesize);
sample->valid = TRUE;
return FLUID_OK;
}

View file

@ -504,7 +504,6 @@ fluid_sample_set_sound_data (fluid_sample_t* sample,
sample->samplerate = sample_rate;
sample->sampletype = FLUID_SAMPLETYPE_MONO;
sample->valid = 1;
sample->auto_free = copy_data;
return FLUID_OK;
@ -751,9 +750,8 @@ int fluid_sample_decompress_vorbis(fluid_sample_t *sample)
// empty sample
if (!sfinfo.frames || !sfinfo.channels)
{
sample->start = sample->end =
sample->loopstart = sample->loopend =
sample->valid = 0;
sample->start = sample->end = 0;
sample->loopstart = sample->loopend = 0;
sample->data = NULL;
sf_close(sndfile);
return FLUID_OK;

View file

@ -183,7 +183,6 @@ struct _fluid_sample_t
int origpitch; /**< Original pitch (MIDI note number, 0-127) */
int pitchadj; /**< Fine pitch adjustment (+/- 99 cents) */
int sampletype; /**< Specifies the type of this sample as indicated by the #fluid_sample_type enum */
int valid; /**< Should be TRUE if sample data is valid, FALSE otherwise (in which case it will not be synthesized) */
int auto_free; /**< TRUE if _fluid_sample_t::data and _fluid_sample_t::data24 should be freed upon sample destruction */
short* data; /**< Pointer to the sample's 16 bit PCM data */
char* data24; /**< If not NULL, pointer to the least significant byte counterparts of each sample data point in order to create 24 bit audio samples */

View file

@ -1726,8 +1726,8 @@ fluid_voice_optimize_sample(fluid_sample_t* s)
double result;
unsigned int i;
/* ignore ROM and other(?) invalid samples */
if (!s->valid) return (FLUID_OK);
/* ignore disabled samples */
if (s->start == s->end) return (FLUID_OK);
if (!s->amplitude_that_reaches_noise_floor_is_valid) { /* Only once */
/* Scan the loop */