diff options
Diffstat (limited to 'src/output/plugins/AlsaOutputPlugin.cxx')
-rw-r--r-- | src/output/plugins/AlsaOutputPlugin.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 7e1919e43..8ccdd2121 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -27,6 +27,7 @@ #include "../OutputAPI.hxx" #include "mixer/MixerList.hxx" #include "pcm/PcmExport.hxx" +#include "system/PeriodClock.hxx" #include "thread/Mutex.hxx" #include "thread/Cond.hxx" #include "util/Manual.hxx" @@ -65,6 +66,8 @@ class AlsaOutput final */ TimerEvent silence_timer; + PeriodClock throttle_silence_log; + Manual<PcmExport> pcm_export; /** @@ -1073,6 +1076,9 @@ try { return; } + if (throttle_silence_log.CheckUpdate(std::chrono::seconds(5))) + FormatWarning(alsa_output_domain, "Decoder is too slow; playing silence to avoid xrun"); + /* insert some silence if the buffer has not enough data yet, to avoid ALSA xrun */ period_buffer.FillWithSilence(silence, out_frame_size); |