HLE DSP: Pop unused samples when loading new buffer
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <iterator>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@@ -370,6 +371,13 @@ namespace Audio {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We're skipping the first samplePosition samples, so remove them from the buffer so as not to consume them later
|
||||||
|
if (source.samplePosition > 0) {
|
||||||
|
auto start = source.currentSamples.begin();
|
||||||
|
auto end = std::next(start, source.samplePosition);
|
||||||
|
source.currentSamples.erase(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
// If the buffer is a looping buffer, re-push it
|
// If the buffer is a looping buffer, re-push it
|
||||||
if (buffer.looping) {
|
if (buffer.looping) {
|
||||||
source.pushBuffer(buffer);
|
source.pushBuffer(buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user