mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Add some RARCH_INTERNAL checks to resampler code to make it
easier to export outside
This commit is contained in:
parent
55154b6e53
commit
75bc44fc8e
@ -25,6 +25,7 @@
|
|||||||
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
#else
|
#else
|
||||||
|
/* FIXME - variadic macros not supported for MSVC 2003 */
|
||||||
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
#else
|
#else
|
||||||
|
/* FIXME - variadic macros not supported for MSVC 2003 */
|
||||||
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
|
|
||||||
|
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
||||||
|
#include "../../general.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static const rarch_resampler_t *resampler_drivers[] = {
|
static const rarch_resampler_t *resampler_drivers[] = {
|
||||||
&sinc_resampler,
|
&sinc_resampler,
|
||||||
#ifdef HAVE_CC_RESAMPLER
|
#ifdef HAVE_CC_RESAMPLER
|
||||||
@ -50,6 +54,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
|||||||
return resampler_drivers[i];
|
return resampler_drivers[i];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef RARCH_INTERNAL
|
||||||
unsigned d;
|
unsigned d;
|
||||||
RARCH_ERR("Couldn't find any resampler driver named \"%s\"\n", ident);
|
RARCH_ERR("Couldn't find any resampler driver named \"%s\"\n", ident);
|
||||||
RARCH_LOG_OUTPUT("Available resampler drivers are:\n");
|
RARCH_LOG_OUTPUT("Available resampler drivers are:\n");
|
||||||
@ -57,6 +62,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
|||||||
RARCH_LOG_OUTPUT("\t%s\n", resampler_drivers[d]->ident);
|
RARCH_LOG_OUTPUT("\t%s\n", resampler_drivers[d]->ident);
|
||||||
|
|
||||||
RARCH_WARN("Going to default to first resampler driver ...\n");
|
RARCH_WARN("Going to default to first resampler driver ...\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
return resampler_drivers[0];
|
return resampler_drivers[0];
|
||||||
}
|
}
|
||||||
@ -69,9 +75,11 @@ void find_prev_resampler_driver(void)
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
strlcpy(g_settings.audio.resampler, resampler_drivers[i - 1]->ident,
|
strlcpy(g_settings.audio.resampler, resampler_drivers[i - 1]->ident,
|
||||||
sizeof(g_settings.audio.resampler));
|
sizeof(g_settings.audio.resampler));
|
||||||
|
#ifdef RARCH_INTERNAL
|
||||||
else
|
else
|
||||||
RARCH_WARN("Couldn't find any previous resampler driver (current one: \"%s\").\n",
|
RARCH_WARN("Couldn't find any previous resampler driver (current one: \"%s\").\n",
|
||||||
g_extern.audio_data.resampler->ident);
|
g_extern.audio_data.resampler->ident);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void find_next_resampler_driver(void)
|
void find_next_resampler_driver(void)
|
||||||
@ -80,9 +88,11 @@ void find_next_resampler_driver(void)
|
|||||||
if (i >= 0 && resampler_drivers[i + 1])
|
if (i >= 0 && resampler_drivers[i + 1])
|
||||||
strlcpy(g_settings.audio.resampler, resampler_drivers[i + 1]->ident,
|
strlcpy(g_settings.audio.resampler, resampler_drivers[i + 1]->ident,
|
||||||
sizeof(g_settings.audio.resampler));
|
sizeof(g_settings.audio.resampler));
|
||||||
|
#ifdef RARCH_INTERNAL
|
||||||
else
|
else
|
||||||
RARCH_WARN("Couldn't find any next resampler driver (current one: \"%s\").\n",
|
RARCH_WARN("Couldn't find any next resampler driver (current one: \"%s\").\n",
|
||||||
g_extern.audio_data.resampler->ident);
|
g_extern.audio_data.resampler->ident);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
#include "resampler.h"
|
#include "resampler.h"
|
||||||
#include "../../libretro.h"
|
#include "../../libretro.h"
|
||||||
|
#ifndef RARCH_INTERNAL
|
||||||
#include "../../performance.h"
|
#include "../../performance.h"
|
||||||
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -25,7 +27,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../../msvc/msvc_compat.h"
|
#include "../../msvc/msvc_compat.h"
|
||||||
|
|
||||||
#ifndef RESAMPLER_TEST
|
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
#else
|
#else
|
||||||
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user