From 14ee8d471aa5aa2eeefd9de0911ee51d0439409e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 21 Feb 2009 16:33:46 +0100 Subject: print warnings about driver bugs at most once --- src/modules/alsa/alsa-source.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/modules/alsa/alsa-source.c') diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 45626896..fbc21f74 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -287,10 +287,12 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled if (PA_UNLIKELY(n_bytes <= 0)) { - 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.")); + if (polled) + PA_ONCE_BEGIN { + 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.")); + } PA_ONCE_END; #ifdef DEBUG_TIMING pa_log_debug("Not reading, because not necessary."); @@ -406,10 +408,12 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled if (PA_UNLIKELY(n_bytes <= 0)) { - 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.")); + if (polled) + PA_ONCE_BEGIN { + 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.")); + } PA_ONCE_END; break; } -- cgit