Ensure that loops are sanitized and sample is optimized for dynamically loaded samples

This commit is contained in:
Marcus Weseloh 2018-04-22 10:37:14 +02:00
parent 4cfdacd905
commit 3ce3575269

View file

@ -1724,7 +1724,12 @@ static int load_preset_samples(fluid_defsfont_t *defsfont, fluid_preset_t *prese
} }
} }
if (fluid_defsfont_load_sampledata(defsfont, sffile, sample) == FLUID_FAILED) if (fluid_defsfont_load_sampledata(defsfont, sffile, sample) == FLUID_OK)
{
fluid_sample_sanitize_loop(sample, (sample->end + 1) * sizeof(short));
fluid_voice_optimize_sample(sample);
}
else
{ {
FLUID_LOG(FLUID_ERR, "Unable to load sample '%s', disabling", sample->name); FLUID_LOG(FLUID_ERR, "Unable to load sample '%s', disabling", sample->name);
sample->start = sample->end = 0; sample->start = sample->end = 0;