From 47eb2ef9ac04bbc95e72942c5b4b3889115b2847 Mon Sep 17 00:00:00 2001 From: Tom M Date: Thu, 3 Aug 2017 20:59:19 +0200 Subject: [PATCH] inform the user about invalid sample loops --- fluidsynth/src/sfloader/fluid_defsfont.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fluidsynth/src/sfloader/fluid_defsfont.c b/fluidsynth/src/sfloader/fluid_defsfont.c index 8bebe4c0..7af0e923 100644 --- a/fluidsynth/src/sfloader/fluid_defsfont.c +++ b/fluidsynth/src/sfloader/fluid_defsfont.c @@ -3159,6 +3159,7 @@ fixup_sample (SFData * sf) { fluid_list_t *p; SFSample *sam; + int invalid_loops=FALSE; p = sf->sample; while (p) @@ -3181,6 +3182,10 @@ fixup_sample (SFData * sf) else if (sam->loopend > sam->end || sam->loopstart >= sam->loopend || sam->loopstart < sam->start) { /* 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) */ if ((sam->end - sam->start) >= 20) { @@ -3202,6 +3207,11 @@ fixup_sample (SFData * sf) p = fluid_list_next (p); } + if(invalid_loops) + { + FLUID_LOG (FLUID_WARN, _("Found samples with invalid loops, audible glitches possible.")); + } + return (OK); }