in src/backend/mod.rs [5064:5090]
fn set_input_mute(&mut self, mute: bool) -> Result<()> {
if self.core_stream_data.input_unit.is_null() {
return Err(Error::invalid_parameter());
}
if !self.core_stream_data.using_voice_processing_unit() {
return Err(Error::error());
}
// Execute set_input_mute in serial queue to avoid racing with destroy or reinit.
let mut result = Err(Error::error());
let set = &mut result;
let stream = &self;
self.queue.run_sync(move || {
*set = set_input_mute(stream.core_stream_data.input_unit, mute);
});
result?;
cubeb_log!(
"Cubeb stream ({:p}) set input mute to {}.",
self as *const AudioUnitStream,
mute
);
self.core_stream_data.input_mute = mute;
Ok(())
}