Refactor common_audio/vad: Create now returns the handle directly instead of an error code

Changed the WebRtcVad_Create() function to the more conventional format of returning the handle directly instead of an error code to take care of.
In addition NULL was changed to nullptr in the files where it applied.

Affected components:
* AGC
* VAD
* NetEQ

BUG=441, 3347
TESTED=locally on Linux and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51919004

Cr-Commit-Position: refs/heads/master@{#9291}
This commit is contained in:
Bjorn Volcker
2015-05-27 07:22:58 +02:00
parent afef4bfd1c
commit de4703c5d1
8 changed files with 28 additions and 44 deletions

View File

@ -908,8 +908,8 @@ int NetEQTest_init_coders(webrtc::NetEqDecoder coder, int enc_frameSize, int bit
for (int k = 0; k < numChannels; k++)
{
ok=WebRtcVad_Create(&VAD_inst[k]);
if (ok!=0) {
VAD_inst[k] = WebRtcVad_Create();
if (!VAD_inst[k]) {
printf("Error: Couldn't allocate memory for VAD instance\n");
exit(0);
}