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: #1048, #3685
  • Loading branch information
zonkmachine committed Nov 21, 2017
1 parent 4a17ebe commit 60d483c
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 60d483c

Please sign in to comment.