Skip to content
Snippets Groups Projects
Commit cd0d6f60 authored by Tim Übelhör's avatar Tim Übelhör
Browse files

Fixed using wrong memory address for channels > 0.

parent 9db582a3
No related branches found
No related tags found
No related merge requests found
......@@ -78,14 +78,16 @@ void NativeWriter::AddRecord(std::vector<std::vector<float>> data)
{
chunkSize = OPTIMAL_CHUNK_SIZE;
}
long samplesAddedInStep = 0;
for (size_t channel = 0; channel < data.size(); channel++)
{
// Write it
long writtenSamples = 0;
checkResult(ADI_AddChannelSamples(_writerHandle, static_cast<long>(channel), data[channel].data() + samplesAdded, chunkSize, &writtenSamples));
// Weird but once the chunk is written to the first channel, all other channels will retunr writtenSamples = 0 :(
samplesAdded += writtenSamples;
samplesAddedInStep += writtenSamples;
}
samplesAdded += samplesAddedInStep;
}
// Close the record
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment