Code clarity fix for CAEFLACDecoder::write_cb

This commit is contained in:
Silent 2018-07-06 00:15:36 +02:00
parent 2ae6c17825
commit 8755dd20d5
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -50,10 +50,10 @@ FLAC__StreamDecoderWriteStatus CAEFLACDecoder::write_cb(const FLAC__StreamDecode
pClientData->m_maxBlockSize = pClientData->m_curBlockSize;
}
std::copy_n( buffer[0], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer, pClientData->m_curBlockSize) );
auto it = std::copy_n( buffer[0], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer, pClientData->m_curBlockSize * processedChannels) );
if ( processedChannels > 1 )
{
std::copy_n( buffer[1], pClientData->m_curBlockSize, stdext::make_checked_array_iterator(pClientData->m_buffer+pClientData->m_curBlockSize, pClientData->m_curBlockSize) );
std::copy_n( buffer[1], pClientData->m_curBlockSize, it );
}
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;