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-util.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/modules/alsa/alsa-util.c') diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index d00a80f1..4340cb39 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "alsa-util.h" @@ -1574,9 +1575,12 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa if (k >= hwbuf_size * 3 || k >= pa_bytes_per_second(ss)*10) - pa_log(_("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). " - "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."), - (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); + + PA_ONCE_BEGIN { + pa_log(_("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). " + "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."), + (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); + } PA_ONCE_END; return n; } @@ -1606,9 +1610,11 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas k >= hwbuf_size * 3 || k >= pa_bytes_per_second(ss)*10) - pa_log(_("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). " - "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."), - (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); + PA_ONCE_BEGIN { + pa_log(_("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). " + "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."), + (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); + } PA_ONCE_END; return r; } -- cgit