Fix invalid output buffer usage

This patch fixes the internal AudioCoder output buffer setting to be set
prior it will be used within callback from ACM

BUG=webrtc:7462

Review-Url: https://codereview.webrtc.org/2806933002
Cr-Commit-Position: refs/heads/master@{#17800}
This commit is contained in:
steweg
2017-04-20 15:19:10 -07:00
committed by Commit bot
parent d41af462fb
commit a1fa491334
2 changed files with 3 additions and 2 deletions

View File

@ -95,10 +95,11 @@ int32_t AudioCoder::Encode(const AudioFrame& audio,
// For any codec with a frame size that is longer than 10 ms the encoded
// length in bytes should be zero until a a full frame has been encoded.
encoded_length_in_bytes_ = 0;
encoded_data_ = encoded_data;
if (acm_->Add10MsData((AudioFrame&)audio_frame) == -1) {
return -1;
}
encoded_data_ = encoded_data;
*encoded_length_in_bytes = encoded_length_in_bytes_;
return 0;
}