Skip to content

Commit

Permalink
fix loasing samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Shilo_XyZ_ authored and Shilo_XyZ_ committed Sep 6, 2020
1 parent 27e58bd commit 1edeff4
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/LineGeneratorStage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,26 @@ void LineGeneratorStage::Ressive(const SamplesPack &samples) {
write_overflow(itl);

auto start = samples.data.cbegin();
auto ovf_count = samples.data.size() % PCMLine::TotalDataLRSamples;
auto ovf_count = (samples.data.size() + overflow.size()) % PCMLine::TotalDataLRSamples;
auto end = samples.data.end() - ovf_count;

overflow.assign(end, samples.data.end()); // replace overflow

for (auto it = start; it != end; ++it) { // it - итератор пары
write_sample(itl, *it);

if (itl == itl_data_end) {
if (generateP) {
*itl = line.generateP();
}
++itl;
if (generateQ && mode14Bit) // skip generate Q if 16 bit mode
{
*itl = line.generateQ();
}

Send(line);

itl = line_start;
if (generateP) {
*itl = line.generateP();
}
++itl;
if (generateQ && mode14Bit) // skip generate Q if 16 bit mode
{
*itl = line.generateQ();
}
Send(line);

itl = line_start;
}

write_sample(itl, *it);
}
}

0 comments on commit 1edeff4

Please sign in to comment.