1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 00:38:44 +00:00

Cleanup of audio_driver_dsp_filter_init - reduce stack usage

This commit is contained in:
twinaphex 2017-09-09 04:56:13 +02:00
parent 1b168bc95e
commit 8654f124d1
2 changed files with 13 additions and 4 deletions

View File

@ -3,6 +3,8 @@ DEPS_DIR := $(ROOT_DIR)/deps
LIBRETRO_COMM_DIR := $(ROOT_DIR)/libretro-common
WANT_WGL = 0
#CFLAGS += -fstack-usage
ifeq ($(HAVE_GL_CONTEXT),)
HAVE_GL_CONTEXT=0

View File

@ -753,12 +753,10 @@ void audio_driver_dsp_filter_free(void)
void audio_driver_dsp_filter_init(const char *device)
{
#if defined(HAVE_DYLIB) && !defined(HAVE_FILTERS_BUILTIN)
char basedir[PATH_MAX_LENGTH];
char ext_name[PATH_MAX_LENGTH];
#endif
struct string_list *plugs = NULL;
#if defined(HAVE_DYLIB) && !defined(HAVE_FILTERS_BUILTIN)
char *basedir = (char*)calloc(PATH_MAX_LENGTH, sizeof(*basedir));
char *ext_name = (char*)calloc(PATH_MAX_LENGTH, sizeof(*ext_name));
fill_pathname_basedir(basedir, device, sizeof(basedir));
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
@ -773,9 +771,18 @@ void audio_driver_dsp_filter_init(const char *device)
if (!audio_driver_dsp)
goto error;
#if defined(HAVE_DYLIB) && !defined(HAVE_FILTERS_BUILTIN)
free(basedir);
free(ext_name);
#endif
return;
error:
#if defined(HAVE_DYLIB) && !defined(HAVE_FILTERS_BUILTIN)
free(basedir);
free(ext_name);
#endif
if (!audio_driver_dsp)
RARCH_ERR("[DSP]: Failed to initialize DSP filter \"%s\".\n", device);
}