From 0347a08ad32b581440e92f4081dbc999e61bc0d5 Mon Sep 17 00:00:00 2001 From: chengqian Date: Sat, 14 Aug 2021 16:50:08 +0800 Subject: [PATCH] Fix _hRecThread,_hPlayThread RTC_DCHECK reverse bug. Bug: webrtc:6779 Change-Id: I030ec010c39ba3755f70b16a64a5163d0857c256 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228721 Reviewed-by: Mirko Bonadei Reviewed-by: Harald Alvestrand Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34793} --- AUTHORS | 1 + modules/audio_device/win/audio_device_core_win.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index b4d4100c6a..645b9f3f2e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,6 +25,7 @@ Ben Strong Berthold Herrmann Bob Withers Bridger Maxwell +Cheng Qian Christophe Dumez Chris Tserng Cody Barnes diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc index 41ed8fc435..6c08fcc4af 100644 --- a/modules/audio_device/win/audio_device_core_win.cc +++ b/modules/audio_device/win/audio_device_core_win.cc @@ -2355,7 +2355,7 @@ int32_t AudioDeviceWindowsCore::StartRecording() { } } - RTC_DCHECK(_hRecThread); + RTC_DCHECK(_hRecThread == NULL); _hRecThread = CreateThread(NULL, 0, lpStartAddress, this, 0, NULL); if (_hRecThread == NULL) { RTC_LOG(LS_ERROR) << "failed to create the recording thread"; @@ -2492,7 +2492,7 @@ int32_t AudioDeviceWindowsCore::StartPlayout() { MutexLock lockScoped(&mutex_); // Create thread which will drive the rendering. - RTC_DCHECK(_hPlayThread); + RTC_DCHECK(_hPlayThread == NULL); _hPlayThread = CreateThread(NULL, 0, WSAPIRenderThread, this, 0, NULL); if (_hPlayThread == NULL) { RTC_LOG(LS_ERROR) << "failed to create the playout thread";