summaryrefslogtreecommitdiffstats
path: root/a52
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-04-13 12:43:41 +0200
committerTakashi Iwai <tiwai@suse.de>2006-04-13 12:43:41 +0200
commitdc7db2162130edc86350b38b6dc3055bd5f41eb6 (patch)
tree92cd86f0b588613179b0d0486e37e16632368e2e /a52
parent608a7e6cc73157a1a20af4de23381e455399df0a (diff)
Accept integer for card option
Accept integer value for card option, as found in the example in a52.txt.
Diffstat (limited to 'a52')
-rw-r--r--a52/pcm_a52.c12
1 files changed, 9 insertions, 3 deletions
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;
}