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
Branches
No related tags found
No related merge requests found
...@@ -78,14 +78,16 @@ void NativeWriter::AddRecord(std::vector<std::vector<float>> data) ...@@ -78,14 +78,16 @@ void NativeWriter::AddRecord(std::vector<std::vector<float>> data)
{ {
chunkSize = OPTIMAL_CHUNK_SIZE; chunkSize = OPTIMAL_CHUNK_SIZE;
} }
long samplesAddedInStep = 0;
for (size_t channel = 0; channel < data.size(); channel++) for (size_t channel = 0; channel < data.size(); channel++)
{ {
// Write it // Write it
long writtenSamples = 0; long writtenSamples = 0;
checkResult(ADI_AddChannelSamples(_writerHandle, static_cast<long>(channel), data[channel].data() + samplesAdded, chunkSize, &writtenSamples)); 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 :( // 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 // Close the record
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment