In reinit(), exit early if something stopped the stream
Reinit is inherently racy. It can be triggered async by the input callback, and the output callback can, between the input callback and reinit(), set the `stopped` flag. In this case, there is no need to continue with the reinit.
This commit is contained in:
Родитель
3563964531
Коммит
c6ce6c20d5
|
@ -4700,6 +4700,11 @@ impl<'ctx> AudioUnitStream<'ctx> {
|
|||
self.core_stream_data.stop_audiounits();
|
||||
}
|
||||
|
||||
if self.stopped.load(Ordering::SeqCst) {
|
||||
// Something stopped the stream, we must not reinit.
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
debug_assert!(
|
||||
!self.core_stream_data.input_unit.is_null()
|
||||
|| !self.core_stream_data.output_unit.is_null()
|
||||
|
|
Загрузка…
Ссылка в новой задаче