rate limit underrun messages
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Feb 2009 19:55:30 +0000 (20:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Feb 2009 19:55:30 +0000 (20:55 +0100)
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index 22460bb..c56614c 100644 (file)
@@ -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;
index 0fd9838..2b42d3f 100644 (file)
@@ -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;