diff options
author | neonloop | 2021-03-26 00:29:45 +0000 |
---|---|---|
committer | neonloop | 2021-03-26 00:29:45 +0000 |
commit | 3ef78ae250b5460bf1b69c4d1f05e27985fa9d1b (patch) | |
tree | 69f7f49c28061c1b70509d2d5f3711fdda58cc9a /frontend | |
parent | 4c26780f101a12d455ffe900e6a0d5238d1c9552 (diff) | |
download | picogpsp-3ef78ae250b5460bf1b69c4d1f05e27985fa9d1b.tar.gz picogpsp-3ef78ae250b5460bf1b69c4d1f05e27985fa9d1b.tar.bz2 picogpsp-3ef78ae250b5460bf1b69c4d1f05e27985fa9d1b.zip |
Drop buffer size to 8192
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/main.c | 12 | ||||
-rw-r--r-- | frontend/plat_linux.c | 2 | ||||
-rw-r--r-- | frontend/plat_trimui.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/frontend/main.c b/frontend/main.c index 49f1cb2..f2b4ec3 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -7,6 +7,11 @@ #include "frontend/plat.h" #include "frontend/libpicofe/plat.h" +/* Percentage of free space allowed in the audio buffer before + * skipping frames. Lower numbers mean more skipping but smoother + * audio, since the buffer will stay closer to filled. */ +#define FRAMESKIP_UNDERRUN_THRESHOLD 0.5 + int should_quit = 0; u32 idle_loop_target_pc = 0xFFFFFFFF; @@ -174,7 +179,7 @@ void synchronize(void) case FRAMESKIP_AUTO: skip_next_frame = 0; - if (capacity > 0.5) { + if (capacity > FRAMESKIP_UNDERRUN_THRESHOLD) { skip_next_frame = 1; skipped_frames++; } @@ -193,11 +198,6 @@ void synchronize(void) skipped_frames = 0; } - while (limit_frames && capacity < 0.1) { - plat_sleep_ms(1); - capacity = plat_sound_capacity(); - } - if (show_fps) { ticks = plat_get_ticks_ms(); if (ticks > nextsec) { diff --git a/frontend/plat_linux.c b/frontend/plat_linux.c index 38e28cc..09d9a48 100644 --- a/frontend/plat_linux.c +++ b/frontend/plat_linux.c @@ -11,7 +11,7 @@ static SDL_Surface* screen; -#define BUF_LEN 16384 +#define BUF_LEN 8192 static short buf[BUF_LEN]; static int buf_w, buf_r; diff --git a/frontend/plat_trimui.c b/frontend/plat_trimui.c index 988a433..bdd5a92 100644 --- a/frontend/plat_trimui.c +++ b/frontend/plat_trimui.c @@ -11,7 +11,7 @@ static SDL_Surface* screen; -#define BUF_LEN 16384 +#define BUF_LEN 8192 static short buf[BUF_LEN]; static int buf_w, buf_r; |