Read $LIBASOUND_DEBUG as integer

Read $LIBASOUND_DEBUG as integer, 1 = hw_params dump, 2 = assert.
This commit is contained in:
Takashi Iwai 2005-04-20 14:26:49 +00:00
parent cac370de25
commit 87ec7df91d
3 changed files with 10 additions and 6 deletions

View file

@ -135,7 +135,7 @@ static void snd_err_msg_default(const char *file, int line, const char *function
fprintf(stderr, ": %s", snd_strerror(err));
putc('\n', stderr);
va_end(arg);
if (! strcmp(verbose, "assert"))
if (! strcmp(verbose, "assert") || atoi(verbose) > 1)
assert(0);
}

View file

@ -23,7 +23,7 @@
#ifndef NDEBUG
/*
* dump hw_params when $LIBASOUND_DEBUG is set
* dump hw_params when $LIBASOUND_DEBUG is set to >= 1
*/
static void dump_hw_params(snd_pcm_hw_params_t *params, const char *type,
snd_pcm_hw_param_t var, unsigned int val, int err)
@ -31,7 +31,7 @@ static void dump_hw_params(snd_pcm_hw_params_t *params, const char *type,
const char *verbose = getenv("LIBASOUND_DEBUG");
snd_output_t *out;
if (! verbose || ! *verbose)
if (! verbose || ! *verbose || atoi(verbose) < 1)
return;
if (snd_output_stdio_attach(&out, stderr, 0) < 0)
return;