Commit 60602b03 authored by henryjandrew's avatar henryjandrew
Browse files

fixed issue in SIMOVDLBase the first time a read cursor read from the VDL by...

fixed issue in SIMOVDLBase the first time a read cursor read from the VDL by adding a check if the cursor had read from the VDL yet
parent 0c5db775
......@@ -80,9 +80,12 @@ public:
int iOverlapSamplesLeft; //! Defines the overlapping samples to the left (towards write cursor) included in each read() call
int iOverlapSamplesRight; //! Defines the overlapping samples to the right (towards beginning of delay line) included in each read() call
bool bInitialized;
//! Default constructor for read cursor with zero delay
inline CITAVDLReadCursor()
{
bInitialized = false;
iNewReadCursorSamples = 0;
iOldReadCursorSamples = 0;
iOverlapSamplesLeft = 0;
......@@ -95,6 +98,7 @@ public:
iOldReadCursorSamples.store( rhs.iOldReadCursorSamples );
iOverlapSamplesLeft = rhs.iOverlapSamplesLeft;
iOverlapSamplesRight = rhs.iOverlapSamplesRight;
bInitialized = rhs.bInitialized;
};
inline CITAVDLReadCursor& operator =( const CITAVDLReadCursor& rhs )
......@@ -103,6 +107,7 @@ public:
iOldReadCursorSamples.store( rhs.iOldReadCursorSamples );
iOverlapSamplesLeft = rhs.iOverlapSamplesLeft;
iOverlapSamplesRight = rhs.iOverlapSamplesRight;
bInitialized = rhs.bInitialized;
return *this;
};
......
......@@ -255,7 +255,7 @@ void CITASIMOVariableDelayLineBase::SetDelaySamples( const int iID, const int iD
oReadCursor.iNewReadCursorSamples = iDelaySamples;
// If not started, set both to avoid artifact on first block
if( !m_bStarted )
if( !m_bStarted || !oReadCursor.bInitialized )
oReadCursor.iOldReadCursorSamples = iDelaySamples;
}
......@@ -293,4 +293,7 @@ void CITASIMOVariableDelayLineBase::Read( const int iCursorID, const int iNumSam
{
m_lUserCursors[ iCursorID ].iOldReadCursorSamples = iNewDelayLocalCopy;
}
if (!oReadCursor.bInitialized)
oReadCursor.bInitialized = true;
}
Markdown is supported
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