obs-filters: Minor code cleanup

Remove some unused variables, fix const qualifier and remove printfs.
master
Richard Stanway 2021-03-15 19:33:31 +01:00
parent 1a05c4f48e
commit d8a434bcc8
3 changed files with 4 additions and 10 deletions

View File

@ -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);

View File

@ -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"),

View File

@ -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);