diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-01-30 14:41:51 +0000 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2006-01-30 14:41:51 +0000 |
commit | eccc92a34d4809cd5926fa054ff7d231ae890c5e (patch) | |
tree | c1ffe2230bb76cf179da60f3052c62eac6619590 /src/seq | |
parent | bf174b704636cc4a3e1d8d6a8e9261957d1386f0 (diff) |
Fix infinite parse of recursive definitions
Fixed the infinite parse (and eventually segfault) of recursive definitions.
Also fixed the parse of a string slave PCM of direct plugins.
Diffstat (limited to 'src/seq')
-rw-r--r-- | src/seq/seq.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/seq/seq.c b/src/seq/seq.c index 2ae83a7a..df7b64e6 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -919,7 +919,8 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name, } static int snd_seq_open_noupdate(snd_seq_t **seqp, snd_config_t *root, - const char *name, int streams, int mode) + const char *name, int streams, int mode, + int hop) { int err; snd_config_t *seq_conf; @@ -928,6 +929,7 @@ static int snd_seq_open_noupdate(snd_seq_t **seqp, snd_config_t *root, SNDERR("Unknown SEQ %s", name); return err; } + snd_config_set_hop(seq_conf, hop); err = snd_seq_open_conf(seqp, name, root, seq_conf, streams, mode); snd_config_delete(seq_conf); return err; @@ -971,7 +973,7 @@ int snd_seq_open(snd_seq_t **seqp, const char *name, err = snd_config_update(); if (err < 0) return err; - return snd_seq_open_noupdate(seqp, snd_config, name, streams, mode); + return snd_seq_open_noupdate(seqp, snd_config, name, streams, mode, 0); } /** @@ -993,9 +995,22 @@ int snd_seq_open_lconf(snd_seq_t **seqp, const char *name, int streams, int mode, snd_config_t *lconf) { assert(seqp && name && lconf); - return snd_seq_open_noupdate(seqp, lconf, name, streams, mode); + return snd_seq_open_noupdate(seqp, lconf, name, streams, mode, 0); } +#ifndef DOC_HIDDEN +int _snd_seq_open_lconf(snd_seq_t **seqp, const char *name, + int streams, int mode, snd_config_t *lconf, + snd_config_t *parent_conf) +{ + int hop; + assert(seqp && name && lconf); + if ((hop = snd_config_check_hop(parent_conf)) < 0) + return hop; + return snd_seq_open_noupdate(seqp, lconf, name, streams, mode, hop + 1); +} +#endif + /** * \brief Close the sequencer * \param seq Handle returned from #snd_seq_open() |