Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit d189a08

Browse files
authored
Fix StopRecording hang for CustomizedAudioCapturer. (#668)
1 parent 9cbc436 commit d189a08

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

talk/owt/sdk/base/customizedaudiocapturer.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,14 @@ int32_t CustomizedAudioCapturer::StartRecording() {
136136
recording_ = true;
137137
const char* thread_name = "owt_audio_module_capture_thread";
138138
thread_rec_ = rtc::PlatformThread::SpawnJoinable(
139-
[this] {
140-
while (RecThreadProcess()) {
141-
}
142-
},
143-
thread_name,
139+
[this] { RecThreadProcess(); }, thread_name,
144140
rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime));
145141
return 0;
146142
}
147143
int32_t CustomizedAudioCapturer::StopRecording() {
148-
webrtc::MutexLock lock(&mutex_);
144+
mutex_.Lock();
149145
recording_ = false;
146+
mutex_.Unlock();
150147
thread_rec_.Finalize();
151148
return 0;
152149
}

0 commit comments

Comments
 (0)