Commit 3d6b1178 authored by Jonas Stienen's avatar Jonas Stienen

Fixing problem in sample frame assignment

parent 636bf228
......@@ -12,16 +12,25 @@
ITASampleBuffer::ITASampleBuffer()
: m_pParent( NULL ), m_iLength( 0 ), m_pfData( NULL ) {}
: m_pParent( NULL )
, m_iLength( 0 )
, m_pfData( NULL )
{
}
ITASampleBuffer::ITASampleBuffer( int iLength, bool bZeroinit )
: m_pParent( NULL ), m_iLength( 0 ), m_pfData( NULL )
: m_pParent( NULL )
, m_iLength( 0 )
, m_pfData( NULL )
{
Init( iLength, bZeroinit );
}
ITASampleBuffer::ITASampleBuffer( const ITASampleBuffer* pSource )
: m_pParent( NULL ), m_iLength( 0 ), m_pfData( NULL )
: m_pParent( NULL )
, m_iLength( 0 )
, m_pfData( NULL )
{
*this = *pSource;
}
......
......@@ -403,15 +403,16 @@ const ITASampleBuffer& ITASampleFrame::operator[](int iChannel) const {
return m_vChannels[iChannel];
}
ITASampleFrame& ITASampleFrame::operator=(const ITASampleFrame& rhs) {
// Selbstzuweisung abfangen
if (&rhs == this) return *this;
ITASampleFrame& ITASampleFrame::operator=( const ITASampleFrame& rhs )
{
// No self assignment
if( &rhs == this )
return *this;
// Neu allozieren
init( rhs.channels(), rhs.length(), false);
init( rhs.channels(), rhs.length(), false );
// Kanaldaten kopieren
for (int i=0; i<m_iChannels; i++) (*this)[i] = rhs[i];
for( int i = 0; i < m_iChannels; i++ )
( *this )[ i ].write( rhs[ i ], this->GetLength() );
return *this;
}
......
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