Forgot that FFmpeg also uses resampler.

This commit is contained in:
Themaister 2014-02-25 09:51:24 +01:00
parent cd597dc247
commit b782778edf

View File

@ -36,11 +36,12 @@ static int find_resampler_driver_index(const char *driver)
return -1; return -1;
} }
static void find_resampler_driver(void) // Resampler is used by multiple modules so avoid clobbering g_extern.audio_data.resampler here.
static const rarch_resampler_t *find_resampler_driver(void)
{ {
int i = find_resampler_driver_index(g_settings.audio.resampler); int i = find_resampler_driver_index(g_settings.audio.resampler);
if (i >= 0) if (i >= 0)
g_extern.audio_data.resampler = backends[i]; return backends[i];
else else
{ {
unsigned d; unsigned d;
@ -48,8 +49,7 @@ static void find_resampler_driver(void)
RARCH_LOG_OUTPUT("Available resampler drivers are:\n"); RARCH_LOG_OUTPUT("Available resampler drivers are:\n");
for (d = 0; backends[d]; d++) for (d = 0; backends[d]; d++)
RARCH_LOG_OUTPUT("\t%s\n", backends[d]->ident); RARCH_LOG_OUTPUT("\t%s\n", backends[d]->ident);
return NULL;
rarch_fail(1, "find_resampler_driver()");
} }
} }
@ -79,8 +79,11 @@ bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const
*re = NULL; *re = NULL;
*backend = NULL; *backend = NULL;
find_resampler_driver(); *backend = find_resampler_driver();
*re = g_extern.audio_data.resampler->init(bw_ratio); if (!*backend)
return false;
*re = (*backend)->init(bw_ratio);
if (!*re) if (!*re)
{ {