common_audio: VADFree() now returns void
* Files in audio_coding are not affected since they never use the return value. * voice_detection in audio_processing does. * Updated vad_unittest.cc BUG=441 TESTED=trybots R=andrew@webrtc.org, tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12059005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5948 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
3dfabf928c
commit
2a796720f8
@ -34,9 +34,7 @@ int WebRtcVad_Create(VadInst** handle);
|
||||
// Frees the dynamic memory of a specified VAD instance.
|
||||
//
|
||||
// - handle [i] : Pointer to VAD instance that should be freed.
|
||||
//
|
||||
// returns : 0 - (OK), -1 - (NULL pointer in)
|
||||
int WebRtcVad_Free(VadInst* handle);
|
||||
void WebRtcVad_Free(VadInst* handle);
|
||||
|
||||
// Initializes a VAD instance.
|
||||
//
|
||||
|
||||
@ -70,7 +70,6 @@ TEST_F(VadTest, ApiTest) {
|
||||
// NULL instance tests
|
||||
EXPECT_EQ(-1, WebRtcVad_Create(NULL));
|
||||
EXPECT_EQ(-1, WebRtcVad_Init(NULL));
|
||||
EXPECT_EQ(-1, WebRtcVad_Free(NULL));
|
||||
EXPECT_EQ(-1, WebRtcVad_set_mode(NULL, kModes[0]));
|
||||
EXPECT_EQ(-1, WebRtcVad_Process(NULL, kRates[0], speech, kFrameLengths[0]));
|
||||
|
||||
@ -121,7 +120,7 @@ TEST_F(VadTest, ApiTest) {
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_EQ(0, WebRtcVad_Free(handle));
|
||||
WebRtcVad_Free(handle);
|
||||
}
|
||||
|
||||
TEST_F(VadTest, ValidRatesFrameLengths) {
|
||||
|
||||
@ -44,14 +44,8 @@ int WebRtcVad_Create(VadInst** handle) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int WebRtcVad_Free(VadInst* handle) {
|
||||
if (handle == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void WebRtcVad_Free(VadInst* handle) {
|
||||
free(handle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO(bjornv): Move WebRtcVad_InitCore() code here.
|
||||
|
||||
@ -164,7 +164,8 @@ void* VoiceDetectionImpl::CreateHandle() const {
|
||||
}
|
||||
|
||||
int VoiceDetectionImpl::DestroyHandle(void* handle) const {
|
||||
return WebRtcVad_Free(static_cast<Handle*>(handle));
|
||||
WebRtcVad_Free(static_cast<Handle*>(handle));
|
||||
return apm_->kNoError;
|
||||
}
|
||||
|
||||
int VoiceDetectionImpl::InitializeHandle(void* handle) const {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user