Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: webrtc/modules/audio_processing/agc/legacy/analog_agc.c

Issue 1175903002: audio_processing: Create now returns a pointer to the object (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/agc/legacy/analog_agc.c
diff --git a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c
index bb56cfe95de89494febf44fb3bda412a27f44dbb..73adb5d3d2fb08560c548b72b3f679f5593b5041 100644
--- a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c
+++ b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c
@@ -1313,31 +1313,19 @@ int WebRtcAgc_get_config(void* agcInst, WebRtcAgcConfig* config) {
return 0;
}
-int WebRtcAgc_Create(void **agcInst)
-{
- LegacyAgc* stt;
- if (agcInst == NULL)
- {
- return -1;
- }
- stt = (LegacyAgc*)malloc(sizeof(LegacyAgc));
-
- *agcInst = stt;
- if (stt == NULL)
- {
- return -1;
- }
+void* WebRtcAgc_Create() {
+ LegacyAgc* stt = malloc(sizeof(LegacyAgc));
#ifdef WEBRTC_AGC_DEBUG_DUMP
- stt->fpt = fopen("./agc_test_log.txt", "wt");
- stt->agcLog = fopen("./agc_debug_log.txt", "wt");
- stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt");
+ stt->fpt = fopen("./agc_test_log.txt", "wt");
+ stt->agcLog = fopen("./agc_debug_log.txt", "wt");
+ stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt");
#endif
- stt->initFlag = 0;
- stt->lastError = 0;
+ stt->initFlag = 0;
+ stt->lastError = 0;
- return 0;
+ return stt;
}
void WebRtcAgc_Free(void *state) {

Powered by Google App Engine
This is Rietveld 408576698