mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
Ensure that loops are sanitized and sample is optimized for dynamically loaded samples
This commit is contained in:
parent
4cfdacd905
commit
3ce3575269
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue