mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 23:11:41 +00:00
Revert "move sample loop fixup to dedicated function"
This reverts commit c254b437d3
.
can not use same loop fix function because logic must be different: SF2 samples are stored in one huge chunk, SF3 decompressed samples stored in individual buffers.
This commit is contained in:
parent
070dc29d20
commit
05929af1dd
1 changed files with 17 additions and 1 deletions
|
@ -1960,7 +1960,23 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
|
|||
sample->start = 0;
|
||||
sample->end = sfinfo.frames - 1;
|
||||
|
||||
fixup_sample_loop(sample);
|
||||
/* loop is fowled?? (cluck cluck :) */
|
||||
if (sample->loopend > sample->end ||
|
||||
sample->loopstart >= sample->loopend ||
|
||||
sample->loopstart <= sample->start)
|
||||
{
|
||||
/* can pad loop by 8 samples and ensure at least 4 for loop (2*8+4) */
|
||||
if ((sample->end - sample->start) >= 20)
|
||||
{
|
||||
sample->loopstart = sample->start + 8;
|
||||
sample->loopend = sample->end - 8;
|
||||
}
|
||||
else /* loop is fowled, sample is tiny (can't pad 8 samples) */
|
||||
{
|
||||
sample->loopstart = sample->start + 1;
|
||||
sample->loopend = sample->end - 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue