aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index af55f0f..e91b832 100644
--- a/main.c
+++ b/main.c
@@ -31,6 +31,8 @@ static int last_screenshot = 0;
static uint32_t vsyncs;
static uint32_t renders;
+#define UNDERRUN_THRESHOLD 0.5
+
static void toggle_fast_forward(int force_off)
{
static int frameskip_style_was;
@@ -198,6 +200,7 @@ void set_defaults(void)
show_hud = 1;
limit_frames = 1;
enable_audio = 1;
+ enable_drc = 1;
audio_buffer_size = 5;
scale_size = SCALE_SIZE_NONE;
scale_filter = SCALE_FILTER_NEAREST;
@@ -496,7 +499,10 @@ static void adjust_audio(void) {
if (current_core.retro_audio_buffer_status) {
float occupancy = 1.0 - plat_sound_capacity();
- current_core.retro_audio_buffer_status(true, (int)(occupancy * 100), occupancy < 0.50);
+ if (enable_drc)
+ occupancy = MIN(1.0, occupancy * 2.0);
+
+ current_core.retro_audio_buffer_status(true, (int)(occupancy * 100), occupancy < UNDERRUN_THRESHOLD);
}
}