many different fixes
This commit is contained in:
1 parent
a583c17916
commit
53801f2b53
36 files changed
+5149
-1291
No files matched your search
+8
-8
@@ -10,9 +10,9 @@ AudioBufferPool& AudioBufferPool::instance() {
|
||||
|
||||
void AudioBufferPool::initialize(size_t bufferSize, size_t poolSize) {
|
||||
bufferSize_ = bufferSize;
|
||||
pool_ = std::make_unique<MemoryPool<float>>(bufferSize, poolSize);
|
||||
ECHOION_LOG_INFO(std::format("AudioBufferPool initialized: {} buffers of {} samples (~{} MB)",
|
||||
poolSize, bufferSize, (bufferSize * poolSize * sizeof(float)) / (1024 * 1024)));
|
||||
pool_ = std::make_unique<MemoryPool<int16_t>>(bufferSize, poolSize);
|
||||
ECHOION_LOG_INFO(std::format("AudioBufferPool initialized: {} buffers of {} samples (~{} KB)",
|
||||
poolSize, bufferSize, (bufferSize * poolSize * sizeof(int16_t)) / 1024));
|
||||
}
|
||||
|
||||
void AudioBufferPool::shutdown() {
|
||||
@@ -20,18 +20,18 @@ void AudioBufferPool::shutdown() {
|
||||
ECHOION_LOG_INFO("AudioBufferPool shutdown");
|
||||
}
|
||||
|
||||
PooledPtr<float> AudioBufferPool::acquireBuffer() {
|
||||
PooledPtr<int16_t> AudioBufferPool::acquireBuffer() {
|
||||
if (!pool_) {
|
||||
return PooledPtr<float>();
|
||||
return PooledPtr<int16_t>();
|
||||
}
|
||||
|
||||
float* ptr = pool_->acquire();
|
||||
int16_t* ptr = pool_->acquire();
|
||||
if (!ptr) {
|
||||
ECHOION_LOG_WARNING("AudioBufferPool exhausted - consider increasing pool size");
|
||||
return PooledPtr<float>();
|
||||
return PooledPtr<int16_t>();
|
||||
}
|
||||
|
||||
return PooledPtr<float>(ptr, pool_.get());
|
||||
return PooledPtr<int16_t>(ptr, pool_.get());
|
||||
}
|
||||
|
||||
size_t AudioBufferPool::getAvailableBuffers() const {
|
||||
|
||||
Reference in new issue
Block a user