make sound rates platform dependent

This commit is contained in:
kub 2024-02-17 19:32:30 +01:00
parent c825b167e9
commit 82b4854771
4 changed files with 7 additions and 2 deletions

View file

@ -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)
{

View file

@ -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;
}

View file

@ -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)

2
plat.h
View file

@ -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;