From 093e4d71463eeea3d3e7b335f3b91e9ebfebed41 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sun, 27 Dec 2020 13:34:25 +0000 Subject: [PATCH] Print less audio - related messages. Signed-off-by: Andrea Odetti --- source/frontends/libretro/rdirectsound.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/frontends/libretro/rdirectsound.cpp b/source/frontends/libretro/rdirectsound.cpp index 8256c514..9f40d5de 100644 --- a/source/frontends/libretro/rdirectsound.cpp +++ b/source/frontends/libretro/rdirectsound.cpp @@ -191,17 +191,12 @@ namespace RDirectSound if (active) { // I am not sure this is any useful - if (underrun_likely) + static unsigned lastOccupancy = 0; + const int diff = std::abs(int(lastOccupancy) - int(occupancy)); + if (diff >= 5) { - if (occupancy < 20) - { - log_cb(RETRO_LOG_INFO, "RA2: %s occupancy = %d, underrun_likely = %d\n", __FUNCTION__, occupancy, underrun_likely); - playSilence(10); - } - if (occupancy > 80) - { - log_cb(RETRO_LOG_INFO, "RA2: %s occupancy = %d, underrun_likely = %d\n", __FUNCTION__, occupancy, underrun_likely); - } + log_cb(RETRO_LOG_INFO, "RA2: %s occupancy = %d, underrun_likely = %d\n", __FUNCTION__, occupancy, underrun_likely); + lastOccupancy = occupancy; } } }