Index: webrtc/modules/rtp_rtcp/source/dtmf_queue.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc b/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc |
index ab21b8704a53785c8e7560fb7796b2aa400de940..81e8b5926e2f6af288fa8bc6df548fd915424544 100644 |
--- a/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc |
+++ b/webrtc/modules/rtp_rtcp/source/dtmf_queue.cc |
@@ -13,20 +13,16 @@ |
#include <string.h> |
namespace webrtc { |
-DTMFqueue::DTMFqueue() |
- : dtmf_critsect_(CriticalSectionWrapper::CreateCriticalSection()), |
- next_empty_index_(0) { |
+DTMFqueue::DTMFqueue() : next_empty_index_(0) { |
memset(dtmf_key_, 0, sizeof(dtmf_key_)); |
memset(dtmf_length, 0, sizeof(dtmf_length)); |
memset(dtmf_level_, 0, sizeof(dtmf_level_)); |
} |
-DTMFqueue::~DTMFqueue() { |
- delete dtmf_critsect_; |
-} |
+DTMFqueue::~DTMFqueue() {} |
int32_t DTMFqueue::AddDTMF(uint8_t key, uint16_t len, uint8_t level) { |
- CriticalSectionScoped lock(dtmf_critsect_); |
+ rtc::CritScope lock(&dtmf_critsect_); |
if (next_empty_index_ >= DTMF_OUTBAND_MAX) { |
return -1; |
@@ -40,7 +36,7 @@ int32_t DTMFqueue::AddDTMF(uint8_t key, uint16_t len, uint8_t level) { |
} |
int8_t DTMFqueue::NextDTMF(uint8_t* dtmf_key, uint16_t* len, uint8_t* level) { |
- CriticalSectionScoped lock(dtmf_critsect_); |
+ rtc::CritScope lock(&dtmf_critsect_); |
if (next_empty_index_ == 0) |
return -1; |
@@ -60,12 +56,12 @@ int8_t DTMFqueue::NextDTMF(uint8_t* dtmf_key, uint16_t* len, uint8_t* level) { |
} |
bool DTMFqueue::PendingDTMF() { |
- CriticalSectionScoped lock(dtmf_critsect_); |
+ rtc::CritScope lock(&dtmf_critsect_); |
return next_empty_index_ > 0; |
} |
void DTMFqueue::ResetDTMF() { |
- CriticalSectionScoped lock(dtmf_critsect_); |
+ rtc::CritScope lock(&dtmf_critsect_); |
next_empty_index_ = 0; |
} |
} // namespace webrtc |