diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-02-04 20:55:30 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-04 20:55:30 +0100 |
commit | 3d33172791197b76fb60d643b2b11c714713eb5b (patch) | |
tree | 7e9bcfb7fde27d00c9b794556d06817f2cb3bfd8 | |
parent | 0933f1a2a401a418a90dc948824e184b5dcc9c93 (diff) |
rate limit underrun messages
-rw-r--r-- | src/modules/alsa/alsa-sink.c | 4 | ||||
-rw-r--r-- | src/modules/alsa/alsa-source.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 22460bb04..c56614c8c 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -190,7 +190,9 @@ static size_t check_left_to_play(struct userdata *u, snd_pcm_sframes_t n) { if (left_to_play > 0) { /* pa_log_debug("%0.2f ms left to play", (double) pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) / PA_USEC_PER_MSEC); */ } else if (!u->first && !u->after_rewind) { - pa_log_info("Underrun!"); + + if (pa_log_ratelimit()) + pa_log_info("Underrun!"); if (u->use_tsched) { size_t old_watermark = u->tsched_watermark; diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 0fd9838c3..2b42d3f92 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -187,7 +187,8 @@ static size_t check_left_to_record(struct userdata *u, snd_pcm_sframes_t n) { if (left_to_record > 0) { /* pa_log_debug("%0.2f ms left to record", (double) pa_bytes_to_usec(left_to_record, &u->source->sample_spec) / PA_USEC_PER_MSEC); */ } else { - pa_log_info("Overrun!"); + if (pa_log_ratelimit()) + pa_log_info("Overrun!"); if (u->use_tsched) { size_t old_watermark = u->tsched_watermark; |