Resolves threading issues when audio is interrupted on iOS.
Before this change we could crash in Debug when WebRTC audio was first
interrupted and then resumed again. The reason was that the new audio
stream stems from a new native I/O thread and that triggered thread
checkers. With this change, failing thread checkers are detached when
audio is interrupted to ensure that they don't fail when audio is restarted.
NOTRY=TRUE
Bug: webrtc:8126
Change-Id: Ib36ff6bc942477730aba60066f049ed0c43d3901
Reviewed-on: https://chromium-review.googlesource.com/628716
Commit-Queue: Henrik Andreasson <henrika@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19465}
diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h
index 04e1be8..2a5a84b 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.h
+++ b/webrtc/modules/audio_device/audio_device_buffer.h
@@ -118,6 +118,12 @@
int32_t SetTypingStatus(bool typing_status);
+ // Called on iOS where the native audio layer can be interrupted by other
+ // audio applications. This method can then be used to reset internal
+ // states and detach thread checkers to allow for a new audio session where
+ // native callbacks may come from a new set of I/O threads.
+ void NativeAudioInterrupted();
+
private:
// Starts/stops periodic logging of audio stats.
void StartPeriodicLogging();