From 700befc8ac877c5c9ee74c69841d31d5f570ee9e Mon Sep 17 00:00:00 2001 From: neonloop Date: Sun, 27 Mar 2022 17:46:39 +0000 Subject: Changes capacity to occupancy and return whole number as percent Avoids float operations and redundant "1 -" --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index e91b832..e004101 100644 --- a/main.c +++ b/main.c @@ -31,7 +31,7 @@ static int last_screenshot = 0; static uint32_t vsyncs; static uint32_t renders; -#define UNDERRUN_THRESHOLD 0.5 +#define UNDERRUN_THRESHOLD 50 static void toggle_fast_forward(int force_off) { @@ -498,11 +498,11 @@ static void adjust_audio(void) { } if (current_core.retro_audio_buffer_status) { - float occupancy = 1.0 - plat_sound_capacity(); + int occupancy = plat_sound_occupancy(); if (enable_drc) - occupancy = MIN(1.0, occupancy * 2.0); + occupancy = MIN(100, occupancy * 2); - current_core.retro_audio_buffer_status(true, (int)(occupancy * 100), occupancy < UNDERRUN_THRESHOLD); + current_core.retro_audio_buffer_status(true, occupancy, occupancy < UNDERRUN_THRESHOLD); } } -- cgit v1.2.3