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

Fixing problem in sample frame assignment

parent 636bf228
...@@ -12,16 +12,25 @@ ...@@ -12,16 +12,25 @@
ITASampleBuffer::ITASampleBuffer() 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 ) 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 ); Init( iLength, bZeroinit );
} }
ITASampleBuffer::ITASampleBuffer( const ITASampleBuffer* pSource ) 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; *this = *pSource;
} }
......
...@@ -403,15 +403,16 @@ const ITASampleBuffer& ITASampleFrame::operator[](int iChannel) const { ...@@ -403,15 +403,16 @@ const ITASampleBuffer& ITASampleFrame::operator[](int iChannel) const {
return m_vChannels[iChannel]; return m_vChannels[iChannel];
} }
ITASampleFrame& ITASampleFrame::operator=(const ITASampleFrame& rhs) { ITASampleFrame& ITASampleFrame::operator=( const ITASampleFrame& rhs )
// Selbstzuweisung abfangen {
if (&rhs == this) return *this; // 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++ )
for (int i=0; i<m_iChannels; i++) (*this)[i] = rhs[i]; ( *this )[ i ].write( rhs[ i ], this->GetLength() );
return *this; 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