mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Honor ident param.
This commit is contained in:
parent
b782778edf
commit
d98af82baf
@ -37,15 +37,15 @@ static int find_resampler_driver_index(const char *driver)
|
||||
}
|
||||
|
||||
// Resampler is used by multiple modules so avoid clobbering g_extern.audio_data.resampler here.
|
||||
static const rarch_resampler_t *find_resampler_driver(void)
|
||||
static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
||||
{
|
||||
int i = find_resampler_driver_index(g_settings.audio.resampler);
|
||||
int i = find_resampler_driver_index(ident);
|
||||
if (i >= 0)
|
||||
return backends[i];
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any resampler driver named \"%s\"\n", g_extern.audio_data.resampler->ident);
|
||||
RARCH_ERR("Couldn't find any resampler driver named \"%s\"\n", ident);
|
||||
RARCH_LOG_OUTPUT("Available resampler drivers are:\n");
|
||||
for (d = 0; backends[d]; d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", backends[d]->ident);
|
||||
@ -79,7 +79,7 @@ bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend, const
|
||||
*re = NULL;
|
||||
*backend = NULL;
|
||||
|
||||
*backend = find_resampler_driver();
|
||||
*backend = find_resampler_driver(ident);
|
||||
if (!*backend)
|
||||
return false;
|
||||
|
||||
|
5
driver.c
5
driver.c
@ -1106,11 +1106,10 @@ void init_audio(void)
|
||||
g_extern.audio_data.src_ratio =
|
||||
(double)g_settings.audio.out_rate / g_settings.audio.in_rate;
|
||||
|
||||
const char *resampler = *g_settings.audio.resampler ? g_settings.audio.resampler : NULL;
|
||||
if (!rarch_resampler_realloc(&g_extern.audio_data.resampler_data, &g_extern.audio_data.resampler,
|
||||
resampler, g_extern.audio_data.orig_src_ratio))
|
||||
g_settings.audio.resampler, g_extern.audio_data.orig_src_ratio))
|
||||
{
|
||||
RARCH_ERR("Failed to initialize resampler \"%s\".\n", resampler ? resampler : "(default)");
|
||||
RARCH_ERR("Failed to initialize resampler \"%s\".\n", g_settings.audio.resampler);
|
||||
g_extern.audio_active = false;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ static bool ffemu_init_audio(ffemu_t *handle)
|
||||
|
||||
rarch_resampler_realloc(&audio->resampler_data,
|
||||
&audio->resampler,
|
||||
*g_settings.audio.resampler ? g_settings.audio.resampler : NULL,
|
||||
g_settings.audio.resampler,
|
||||
audio->ratio);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user