Commit 2932d2db authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Style and trying to find issue with uninitialized return buffer from VDL

parent 6a775bd5
......@@ -16,7 +16,7 @@
// Interpolation resampling factor range (otherwise crossfading is used)
#define MIN_RESAMPLING_FACTOR 0.0f // [0, inf) ... aber sinnvoll z.B. 0, 0.1, 0.5 (< 1)
#define MIN_RESAMPLING_FACTOR 0.01f // [0, inf) ... aber sinnvoll z.B. 0, 0.1, 0.5 (< 1)
#define MAX_RESAMPLING_FACTOR 25.0f // [0, inf) ... aber sinnvoll z.B. 1, 1.5, 2, 3 (> 1)
......@@ -61,7 +61,8 @@ CITAVariableDelayLine::CITAVariableDelayLine( double dSamplerate,
Clear();
}
void CITAVariableDelayLine::Clear() {
void CITAVariableDelayLine::Clear()
{
m_psbVDLBuffer->Zero();
m_psbTemp->Zero();
......@@ -157,7 +158,8 @@ void CITAVariableDelayLine::ReserveMaximumDelaySamples( float fMaxDelaySamples )
{
// Puffer schon gross genug => Nichts tun...
if( m_psbVDLBuffer->length() >= iNewBufferSize ) return;
if( m_psbVDLBuffer->length() >= iNewBufferSize )
return;
m_swBufferSizeInc.start();
......@@ -284,7 +286,8 @@ void CITAVariableDelayLine::Process( const ITASampleBuffer* psbInput, ITASampleB
// --= Keine nderung der Verzgerung (fr rasant schnelle statische Szenen) =--
if( fNewDelay == fCurrentDelay ) {
if( fNewDelay == fCurrentDelay )
{
// Keine nderung der Verzgerung. Einfach Anfang der VDL in den Ausgang kopieren.
int iReadCursor = ( m_iWriteCursor + m_iVDLBufferSize - ( int ) ceil( fCurrentDelay ) ) % m_iVDLBufferSize;
psbOutput->cyclic_write( m_psbVDLBuffer, m_iBlockLength, iReadCursor, 0 );
......@@ -441,6 +444,12 @@ void CITAVariableDelayLine::Process( const ITASampleBuffer* psbInput, ITASampleB
int iInputStartOffset = iLeft;
m_pInterpolationRoutine->Interpolate( m_psbTemp, iInputLength, iInputStartOffset, psbOutput, m_iBlockLength );
for( int k = 0; k < psbOutput->GetLength(); k++ )
{
if( isnan( psbOutput->GetData()[ k ] ) )
ITA_EXCEPT1( INVALID_PARAMETER, "VDL produced NAN value when switching from " + IntToString( iCurrentIntDelay ) + " to " + IntToString( iNewIntDelay ) + " with interpolation" );
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment