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

@ -44,11 +44,11 @@ Satender Saroha <ssaroha@yahoo.com>
Sarah Thompson <sarah@telergy.com>
Saul Kravitz <Saul.Kravitz@celera.com>
Silviu Caragea <silviu.cpp@gmail.com>
Stefan Gula <steweg@gmail.com>
Steve Reid <sreid@sea-to-sky.net>
Vladimir Beloborodov <VladimirTechMan@gmail.com>
Vicken Simonian <vsimon@gmail.com>
Victor Costan <costan@gmail.com>
Stefan Gula <steweg@gmail.com>
&yet LLC <*@andyet.com>
Agora IO <*@agora.io>

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;
}