Allow StartRecording if capturer is null in test ADM Bug: b/272350185 Change-Id: I3aca6d8b3eb4fd39a6d39f1fea272858e18193bc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311463 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Auto-Submit: Artem Titov <titovartem@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40407}
diff --git a/modules/audio_device/test_audio_device_impl.cc b/modules/audio_device/test_audio_device_impl.cc index c5de40c..627e68b 100644 --- a/modules/audio_device/test_audio_device_impl.cc +++ b/modules/audio_device/test_audio_device_impl.cc
@@ -139,7 +139,6 @@ int32_t TestAudioDevice::StartRecording() { MutexLock lock(&lock_); - RTC_CHECK(capturer_); capturing_ = true; return 0; } @@ -165,7 +164,7 @@ if (audio_buffer_ == nullptr) { return; } - if (capturing_) { + if (capturing_ && capturer_ != nullptr) { // Capture 10ms of audio. 2 bytes per sample. const bool keep_capturing = capturer_->Capture(&recording_buffer_); if (recording_buffer_.size() > 0) {