mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-04 10:01:16 +00:00
inform the user about invalid sample loops
This commit is contained in:
parent
2d5da02cd4
commit
47eb2ef9ac
1 changed files with 10 additions and 0 deletions
|
@ -3159,6 +3159,7 @@ fixup_sample (SFData * sf)
|
||||||
{
|
{
|
||||||
fluid_list_t *p;
|
fluid_list_t *p;
|
||||||
SFSample *sam;
|
SFSample *sam;
|
||||||
|
int invalid_loops=FALSE;
|
||||||
|
|
||||||
p = sf->sample;
|
p = sf->sample;
|
||||||
while (p)
|
while (p)
|
||||||
|
@ -3181,6 +3182,10 @@ fixup_sample (SFData * sf)
|
||||||
else if (sam->loopend > sam->end || sam->loopstart >= sam->loopend
|
else if (sam->loopend > sam->end || sam->loopstart >= sam->loopend
|
||||||
|| sam->loopstart < sam->start)
|
|| sam->loopstart < sam->start)
|
||||||
{ /* loop is fowled?? (cluck cluck :) */
|
{ /* loop is fowled?? (cluck cluck :) */
|
||||||
|
FLUID_LOG (FLUID_DBG, _("Sample '%s' has invalid loop,"
|
||||||
|
" extending loop to full sample"), sam->name);
|
||||||
|
invalid_loops |= TRUE;
|
||||||
|
|
||||||
/* can pad loop by 8 samples and ensure at least 4 for loop (2*8+4) */
|
/* can pad loop by 8 samples and ensure at least 4 for loop (2*8+4) */
|
||||||
if ((sam->end - sam->start) >= 20)
|
if ((sam->end - sam->start) >= 20)
|
||||||
{
|
{
|
||||||
|
@ -3202,6 +3207,11 @@ fixup_sample (SFData * sf)
|
||||||
p = fluid_list_next (p);
|
p = fluid_list_next (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(invalid_loops)
|
||||||
|
{
|
||||||
|
FLUID_LOG (FLUID_WARN, _("Found samples with invalid loops, audible glitches possible."));
|
||||||
|
}
|
||||||
|
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue