Index: webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc |
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc b/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc |
index 4003b26e70f94f5a5288ac8138813794ad76db8b..c7999b56be36deb1f6e54f09dd77ecd8c75da3c5 100644 |
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc |
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/audio_encoder_isacfix.cc |
@@ -67,6 +67,7 @@ int AudioEncoderDecoderMutableIsacFix::Decode(const uint8_t* encoded, |
size_t max_decoded_bytes, |
int16_t* decoded, |
SpeechType* speech_type) { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->Decode(encoded, encoded_len, sample_rate_hz, |
max_decoded_bytes, decoded, speech_type); |
} |
@@ -78,20 +79,24 @@ int AudioEncoderDecoderMutableIsacFix::DecodeRedundant( |
size_t max_decoded_bytes, |
int16_t* decoded, |
SpeechType* speech_type) { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->DecodeRedundant(encoded, encoded_len, sample_rate_hz, |
max_decoded_bytes, decoded, speech_type); |
} |
bool AudioEncoderDecoderMutableIsacFix::HasDecodePlc() const { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->HasDecodePlc(); |
} |
int AudioEncoderDecoderMutableIsacFix::DecodePlc(int num_frames, |
int16_t* decoded) { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->DecodePlc(num_frames, decoded); |
} |
int AudioEncoderDecoderMutableIsacFix::Init() { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->Init(); |
} |
@@ -101,32 +106,38 @@ int AudioEncoderDecoderMutableIsacFix::IncomingPacket( |
uint16_t rtp_sequence_number, |
uint32_t rtp_timestamp, |
uint32_t arrival_timestamp) { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->IncomingPacket(payload, payload_len, rtp_sequence_number, |
rtp_timestamp, arrival_timestamp); |
} |
int AudioEncoderDecoderMutableIsacFix::ErrorCode() { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->ErrorCode(); |
} |
int AudioEncoderDecoderMutableIsacFix::PacketDuration( |
const uint8_t* encoded, |
size_t encoded_len) const { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->PacketDuration(encoded, encoded_len); |
} |
int AudioEncoderDecoderMutableIsacFix::PacketDurationRedundant( |
const uint8_t* encoded, |
size_t encoded_len) const { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->PacketDurationRedundant(encoded, encoded_len); |
} |
bool AudioEncoderDecoderMutableIsacFix::PacketHasFec(const uint8_t* encoded, |
size_t encoded_len) const { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->PacketHasFec(encoded, encoded_len); |
} |
size_t AudioEncoderDecoderMutableIsacFix::Channels() const { |
+ CriticalSectionScoped cs(encoder_lock_.get()); |
return encoder()->Channels(); |
} |