diff options
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; |