diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 19:39:12 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 19:39:12 +0000 |
commit | f0424318479863edeed2a6a128e6d1ac926966e3 (patch) | |
tree | 4fd144260e58c9a66d331fc81b46473723452479 /channels/chan_alsa.c | |
parent | c8ca7d2f263f5161ce1b29ec2c9de835131fc950 (diff) |
Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69327 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_alsa.c')
-rw-r--r-- | channels/chan_alsa.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index feed79e04..de8f3ffef 100644 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -365,8 +365,7 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) ast_log(LOG_ERROR, "snd_pcm_open failed: %s\n", snd_strerror(err)); return NULL; } else { - if (option_debug) - ast_log(LOG_DEBUG, "Opening device %s in %s mode\n", dev, (stream == SND_PCM_STREAM_CAPTURE) ? "read" : "write"); + ast_debug(1, "Opening device %s in %s mode\n", dev, (stream == SND_PCM_STREAM_CAPTURE) ? "read" : "write"); } snd_pcm_hw_params_alloca(&hwparams); @@ -394,8 +393,7 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) if (err < 0) ast_log(LOG_ERROR, "period_size(%ld frames) is bad: %s\n", period_size, snd_strerror(err)); else { - if (option_debug) - ast_log(LOG_DEBUG, "Period size is %d\n", err); + ast_debug(1, "Period size is %d\n", err); } buffer_size = 4096 * 2; /* period_size * 16; */ @@ -403,8 +401,7 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) if (err < 0) ast_log(LOG_WARNING, "Problem setting buffer size of %ld: %s\n", buffer_size, snd_strerror(err)); else { - if (option_debug) - ast_log(LOG_DEBUG, "Buffer size is set to %d frames\n", err); + ast_debug(1, "Buffer size is set to %d frames\n", err); } #if 0 @@ -465,13 +462,11 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) if (err <= 0) ast_log(LOG_ERROR, "Unable to get a poll descriptors count, error is %s\n", snd_strerror(err)); if (err != 1) { - if (option_debug) - ast_log(LOG_DEBUG, "Can't handle more than one device\n"); + ast_debug(1, "Can't handle more than one device\n"); } snd_pcm_poll_descriptors(handle, &pfd, err); - if (option_debug) - ast_log(LOG_DEBUG, "Acquired fd %d from the poll descriptor\n", pfd.fd); + ast_debug(1, "Acquired fd %d from the poll descriptor\n", pfd.fd); if (stream == SND_PCM_STREAM_CAPTURE) readdev = pfd.fd; @@ -634,8 +629,7 @@ static int alsa_write(struct ast_channel *chan, struct ast_frame *f) res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2); if (res == -EPIPE) { #if DEBUG - if (option_debug) - ast_log(LOG_DEBUG, "XRUN write\n"); + ast_debug(1, "XRUN write\n"); #endif snd_pcm_prepare(alsa.ocard); res = snd_pcm_writei(alsa.ocard, sizbuf, len / 2); |