Skip to content
Snippets Groups Projects
Commit 52ade14d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud
Browse files

audio: resample in call tone

Fix crash on macOS when receiving a call during another running call

Change-Id: I251fe0ca34a6ec12ebe63f6c3915c535821e25e6
parent 0b2db06a
Branches
Tags
No related merge requests found
...@@ -155,7 +155,7 @@ AudioLayer::getToPlay(AudioFormat format, size_t writableSamples) ...@@ -155,7 +155,7 @@ AudioLayer::getToPlay(AudioFormat format, size_t writableSamples)
while (!(playbackBuf = playbackQueue_->dequeue())) { while (!(playbackBuf = playbackQueue_->dequeue())) {
if (auto urgentSamples = urgentRingBuffer_.get(RingBufferPool::DEFAULT_ID)) { if (auto urgentSamples = urgentRingBuffer_.get(RingBufferPool::DEFAULT_ID)) {
bufferPool.discard(1, RingBufferPool::DEFAULT_ID); bufferPool.discard(1, RingBufferPool::DEFAULT_ID);
playbackQueue_->enqueue(std::move(urgentSamples)); playbackQueue_->enqueue(resampler_->resample(std::move(urgentSamples),format));
} else if (auto toneToPlay = Manager::instance().getTelephoneTone()) { } else if (auto toneToPlay = Manager::instance().getTelephoneTone()) {
playbackQueue_->enqueue(resampler_->resample(toneToPlay->getNext(), format)); playbackQueue_->enqueue(resampler_->resample(toneToPlay->getNext(), format));
} else if (auto buf = bufferPool.getData(RingBufferPool::DEFAULT_ID)) { } else if (auto buf = bufferPool.getData(RingBufferPool::DEFAULT_ID)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment