From a1a81db68049e73b0021da6cdb40892eefb143a9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Feb 2015 19:04:46 +0100 Subject: [PATCH] (audio_resampler_driver) Cleanups --- audio/audio_resampler_driver.c | 17 +++++++++++++---- audio/audio_resampler_driver.h | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/audio/audio_resampler_driver.c b/audio/audio_resampler_driver.c index cb2d7ddcc2..67d7ad37ae 100644 --- a/audio/audio_resampler_driver.c +++ b/audio/audio_resampler_driver.c @@ -121,13 +121,13 @@ const char* config_get_audio_resampler_driver_options(void) if (!options) { - string_list_free(options_l); - options_l = NULL; - return NULL; + options = NULL; + goto done; } string_list_join_concat(options, options_len, options_l, "|"); +done: string_list_free(options_l); options_l = NULL; @@ -164,6 +164,15 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident) return resampler_drivers[0]; } +resampler_simd_mask_t resampler_get_cpu_features(void) +{ +#ifdef RARCH_INTERNAL + return rarch_get_cpu_features(); +#else + return perf_get_cpu_features(); +#endif +} + /** * resampler_append_plugs: * @re : Resampler handle @@ -178,7 +187,7 @@ static bool resampler_append_plugs(void **re, const rarch_resampler_t **backend, double bw_ratio) { - resampler_simd_mask_t mask = rarch_get_cpu_features(); + resampler_simd_mask_t mask = resampler_get_cpu_features(); *re = (*backend)->init(&resampler_config, bw_ratio, mask); diff --git a/audio/audio_resampler_driver.h b/audio/audio_resampler_driver.h index ad88d9a372..1ca818a5fa 100644 --- a/audio/audio_resampler_driver.h +++ b/audio/audio_resampler_driver.h @@ -201,6 +201,10 @@ bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, (backend)->process(handle, data); \ } while(0) +#ifndef RARCH_INTERNAL +extern retro_get_cpu_features_t perf_get_cpu_features_cb; +#endif + #ifdef __cplusplus } #endif