From 82b4854771302e23201de274eee2969fc28be8be Mon Sep 17 00:00:00 2001 From: kub Date: Sat, 17 Feb 2024 19:32:30 +0100 Subject: [PATCH] make sound rates platform dependent --- gp2x/plat.c | 3 ++- linux/plat.c | 2 +- pandora/plat.c | 2 ++ plat.h | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gp2x/plat.c b/gp2x/plat.c index e80b0fb..2e06e41 100644 --- a/gp2x/plat.c +++ b/gp2x/plat.c @@ -45,7 +45,8 @@ static const char * const caanoo_keys[KEY_MAX + 1] = { }; /* to be filled by mmsp2/pollux _init */ -struct plat_target plat_target; +static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 53000, -1 }; +struct plat_target plat_target = { .sound_rates = sound_rates }; int plat_target_init(void) { diff --git a/linux/plat.c b/linux/plat.c index 707d5f7..9ed3637 100644 --- a/linux/plat.c +++ b/linux/plat.c @@ -116,7 +116,7 @@ unsigned int plat_get_ticks_ms(void) ret = (unsigned)tv.tv_sec * 1000; /* approximate /= 1000 */ - ret += ((unsigned)tv.tv_usec * 4195) >> 22; + ret += ((unsigned)tv.tv_usec * 4194) >> 22; return ret; } diff --git a/pandora/plat.c b/pandora/plat.c index fbb670c..d292f01 100644 --- a/pandora/plat.c +++ b/pandora/plat.c @@ -239,6 +239,7 @@ static int switch_layer(int which, int enable) return ret; } +static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 53000, -1 }; struct plat_target plat_target = { cpu_clock_get, cpu_clock_set, @@ -247,6 +248,7 @@ struct plat_target plat_target = { lcdrate_set, gamma_set, .switch_layer = switch_layer, + .sound_rates = sound_rates, }; int plat_target_init(void) diff --git a/plat.h b/plat.h index ba4e0eb..a5dfc79 100644 --- a/plat.h +++ b/plat.h @@ -46,6 +46,8 @@ struct plat_target { int vout_fullscreen; const char **hwfilters; int hwfilter; + const int *sound_rates; + int sound_rate; }; extern struct plat_target plat_target; -- 2.39.5