]> code.delx.au - pulseaudio/commitdiff
use pa_log_ratelimit() at a few places
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Jan 2009 23:12:12 +0000 (00:12 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Jan 2009 23:12:12 +0000 (00:12 +0100)
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index f092b5d0074656807721b346eb8df84833b4bc4a..94b289ff0ebf2657aab0a0a24cec773ce44613d4 100644 (file)
@@ -251,7 +251,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle
 
         if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
 
-            if (polled)
+            if (polled && pa_log_ratelimit())
                 pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
                        "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
                        "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0.");
@@ -374,7 +374,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle
 
         if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
 
-            if (polled)
+            if (polled && pa_log_ratelimit())
                 pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
                        "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
                        "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0.");
@@ -1194,7 +1194,7 @@ static void thread_func(void *userdata) {
                 u->since_start = 0;
             }
 
-            if (revents && u->use_tsched)
+            if (revents && u->use_tsched && pa_log_ratelimit())
                 pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
         } else
             revents = 0;
index 0c4e5bc600d192cedd761a449c3f2ba6946bfbd9..b8ad2e25b45781e2a575d114cd5f3121d3e53893 100644 (file)
@@ -238,7 +238,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
 
         if (PA_UNLIKELY(n <= 0)) {
 
-            if (polled)
+            if (polled && pa_log_ratelimit())
                 pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
                        "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
                        "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0.");
@@ -346,7 +346,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
 
         if (PA_UNLIKELY(n <= 0)) {
 
-            if (polled)
+            if (polled && pa_log_ratelimit())
                 pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
                        "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
                        "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0.");
@@ -1029,7 +1029,7 @@ static void thread_func(void *userdata) {
                 snd_pcm_start(u->pcm_handle);
             }
 
-            if (revents && u->use_tsched)
+            if (revents && u->use_tsched && pa_log_ratelimit())
                 pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
         } else
             revents = 0;