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:
2
AUTHORS
2
AUTHORS
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user