1
0
Эх сурвалжийг харах

obs-filters: Minor code cleanup

Remove some unused variables, fix const qualifier and remove printfs.
Richard Stanway 4 жил өмнө
parent
commit
d8a434bcc8

+ 2 - 4
plugins/obs-filters/noise-suppress-filter.c

@@ -108,8 +108,7 @@ struct noise_suppress_data {
 	uint32_t sample_rate;
 	float intensity_ratio;
 	unsigned int num_samples_per_frame, num_channels;
-	const char *sdk_path;
-	const char *model;
+	char *model;
 
 	/* Resampler */
 	audio_resampler_t *nvafx_resampler;
@@ -487,13 +486,12 @@ static void *noise_suppress_create(obs_data_t *settings, obs_source_t *filter)
 		size_t size = strlen(sdk_path) + strlen(file) + 1;
 		char *buffer = (char *)bmalloc(size);
 
-		ng->sdk_path = sdk_path;
 		strcpy(buffer, sdk_path);
 		strcat(buffer, file);
 		ng->model = buffer;
 		ng->nvafx_enabled = true;
 
-		info("NVAFX SDK redist path was found here %s", ng->sdk_path);
+		info("NVAFX SDK redist path was found here %s", sdk_path);
 	}
 #endif
 	noise_suppress_update(ng, settings);

+ 1 - 1
plugins/obs-filters/nvafx-load.h

@@ -129,7 +129,7 @@ static bool nvafx_get_sdk_path(char buffer[MAX_PATH])
 	char value[MAX_PATH];
 	PVOID pvData = value;
 	DWORD BufferSize = 8192;
-	LPDWORD pcbData;
+
 	LSTATUS status = RegGetValue(
 		HKEY_LOCAL_MACHINE,
 		TEXT("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"),

+ 1 - 5
plugins/obs-filters/obs-filters.c

@@ -61,11 +61,7 @@ bool obs_module_load(void)
 #if NOISEREDUCTION_ENABLED
 #ifdef LIBNVAFX_ENABLED
 	/* load nvidia audio fx dll */
-	if (!load_nvafx()) {
-		printf("[noise suppress: Unable to load NVAudioEffects.dll.]");
-	} else {
-		printf("[noise suppress: NVAudioEffects.dll loaded.]");
-	}
+	load_nvafx();
 #endif
 	obs_register_source(&noise_suppress_filter);
 	obs_register_source(&noise_suppress_filter_v2);