plugin/ap: don't load empty chunks
This commit is contained in:
parent
833cd8fbfa
commit
73233b97c1
1 changed files with 6 additions and 1 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
namespace caelestia {
|
namespace caelestia {
|
||||||
|
|
||||||
|
|
@ -73,7 +74,11 @@ void AudioCollector::loadChunk() {
|
||||||
i += toCopy;
|
i += toCopy;
|
||||||
|
|
||||||
if (m_chunkOffset == m_chunkSize) {
|
if (m_chunkOffset == m_chunkSize) {
|
||||||
m_provider->loadChunk(m_chunk);
|
if (std::any_of(m_chunk.constBegin(), m_chunk.constEnd(), [](double d) {
|
||||||
|
return std::abs(d) > 1e-6;
|
||||||
|
})) {
|
||||||
|
m_provider->loadChunk(m_chunk);
|
||||||
|
}
|
||||||
m_chunkOffset = 0;
|
m_chunkOffset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue