summaryrefslogtreecommitdiffstats
path: root/src/ManagementServer.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-07 15:28:21 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-07 15:28:21 +0100
commitc85c9cc40d05c89b3fa6de997590ab488c13cb2e (patch)
tree58064e74c67320727ca794c11e004d14d1a0e647 /src/ManagementServer.h
parentf7addcf7d00621f0973f2c6a997893ff3d7f6c3e (diff)
downloaddabmux-c85c9cc40d05c89b3fa6de997590ab488c13cb2e.tar.gz
dabmux-c85c9cc40d05c89b3fa6de997590ab488c13cb2e.tar.bz2
dabmux-c85c9cc40d05c89b3fa6de997590ab488c13cb2e.zip
Introduce slow peak statistic, averaging over 5 minutes
Diffstat (limited to 'src/ManagementServer.h')
-rw-r--r--src/ManagementServer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ManagementServer.h b/src/ManagementServer.h
index 274dece..17b8bda 100644
--- a/src/ManagementServer.h
+++ b/src/ManagementServer.h
@@ -117,11 +117,14 @@ class InputStat
uint32_t m_num_overruns;
// Peak audio levels (linear 16-bit PCM) for the two channels.
- // Keep a FIFO of values from the last few seconds
+ // Keep a FIFO of values from the last minutes, apply
+ // a short window to also see short-term fluctuations.
std::deque<int> m_peaks_left;
std::deque<int> m_peaks_right;
std::chrono::time_point<std::chrono::steady_clock> m_time_last_peak_notify;
+ size_t m_short_window_length = 0;
+
/************* STATE ***************/
/* Variables used for determining the input state */
int m_glitch_counter; // saturating counter