Commit d18192bd authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud

call: mute audio on macOS

Change-Id: If1b0abb2939fae2d6374991616419a5703bec09e
parent ed699537
......@@ -338,9 +338,13 @@ CoreLayer::read(AudioUnitRenderActionFlags* ioActionFlags,
auto format = audioInputFormat_;
format.sampleFormat = AV_SAMPLE_FMT_FLTP;
auto inBuff = std::make_unique<AudioFrame>(format, inNumberFrames);
auto& in = *inBuff->pointer();
for (unsigned i = 0; i < inChannelsPerFrame_; ++i)
std::copy_n((Float32*)captureBuff_->mBuffers[i].mData, inNumberFrames, (Float32*)in.extended_data[i]);
if (isCaptureMuted_) {
libav_utils::fillWithSilence(inBuff->pointer());
} else {
auto& in = *inBuff->pointer();
for (unsigned i = 0; i < inChannelsPerFrame_; ++i)
std::copy_n((Float32*)captureBuff_->mBuffers[i].mData, inNumberFrames, (Float32*)in.extended_data[i]);
}
mainRingBuffer_->put(std::move(inBuff));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment