From dc7db2162130edc86350b38b6dc3055bd5f41eb6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 13 Apr 2006 12:43:41 +0200 Subject: Accept integer for card option Accept integer value for card option, as found in the example in a52.txt. --- a52/pcm_a52.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'a52') diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 1cc7b6f..84706fe 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -566,7 +566,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52) unsigned int bitrate = 448; unsigned int channels = 6; snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; - char devstr[128]; + char devstr[128], tmpcard[8]; struct a52_ctx *rec; if (stream != SND_PCM_STREAM_PLAYBACK) { @@ -583,8 +583,14 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52) continue; if (strcmp(id, "card") == 0) { if (snd_config_get_string(n, &card) < 0) { - SNDERR("Invalid type for %s", id); - return -EINVAL; + long val; + err = snd_config_get_integer(n, &val); + if (err < 0) { + SNDERR("Invalid type for %s", id); + return -EINVAL; + } + snprintf(tmpcard, sizeof(tmpcard), "%ld", val); + card = tmpcard; } continue; } -- cgit