From 829a9625636c3697095ba70322c6fffdf630a76f Mon Sep 17 00:00:00 2001 From: jianjunz Date: Fri, 1 Sep 2023 13:13:19 +0800 Subject: [PATCH] Reset counters when stop recording. (#732) Capturer caculates the time of next GenerateFramesForNext10Ms based on these counters. If they are not reset when stop recording, new session will send out too much data in the begining. --- talk/owt/sdk/base/customizedaudiocapturer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/talk/owt/sdk/base/customizedaudiocapturer.cc b/talk/owt/sdk/base/customizedaudiocapturer.cc index 645826c33..0f613de44 100644 --- a/talk/owt/sdk/base/customizedaudiocapturer.cc +++ b/talk/owt/sdk/base/customizedaudiocapturer.cc @@ -145,6 +145,10 @@ int32_t CustomizedAudioCapturer::StopRecording() { recording_ = false; mutex_.Unlock(); thread_rec_.Finalize(); + last_call_record_millis_ = 0; + last_thread_rec_end_time_ = 0; + need_sleep_ms_ = 0; + real_sleep_ms_ = 0; return 0; } bool CustomizedAudioCapturer::Recording() const {