Skip to content

Commit

Permalink
Turn on effect chain sanity checks
Browse files Browse the repository at this point in the history
This will check for infs/nans in between the effect units and will clear
up most cases where projects with bad data would simply cut out all sound
at one point or be all silent. It comes with a slight performance hit of
some 2% more cycles. The down side is that now instead of cutting out
at the point of bad data some large signals will get through that could
potentially hurt equipment.

Resolves: LMMS#1048, LMMS#3685
  • Loading branch information
zonkmachine committed Jul 20, 2017
1 parent 4bbef3e commit ae6906f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/core/EffectChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,16 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b
{
return false;
}
const bool exporting = Engine::getSong()->isExporting();
if( exporting ) // strip infs/nans if exporting
{
MixHelpers::sanitize( _buf, _frames );
}

MixHelpers::sanitize( _buf, _frames );

bool moreEffects = false;
for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); ++it )
{
if( hasInputNoise || ( *it )->isRunning() )
{
moreEffects |= ( *it )->processAudioBuffer( _buf, _frames );
if( exporting ) // strip infs/nans if exporting
{
MixHelpers::sanitize( _buf, _frames );
}
MixHelpers::sanitize( _buf, _frames );
}
}

Expand Down

0 comments on commit ae6906f

Please sign in to comment.