From: fuweix.tang@intel.com
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com,
Fuwei Tang <fuweix.tang@intel.com>,
mengdong.lin@intel.com
Subject: [PATCH v2] topology: Fix issue in parsing routes when generating topology binary
Date: Fri, 5 May 2017 15:57:20 +0800 [thread overview]
Message-ID: <1493971040-15628-1-git-send-email-fuweix.tang@intel.com> (raw)
From: Fuwei Tang <fuweix.tang@intel.com>
We missed parsing the index value, which is used as a use case indicator, when
processing the route objects.
This patch fixes the bug.
Signed-off-by: Fuwei Tang <fuweix.tang@intel.com>
Tested-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
src/topology/dapm.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index 13aa1c4..6af750b 100644
--- a/src/topology/dapm.c
+++ b/src/topology/dapm.c
@@ -381,7 +381,7 @@ done:
}
-static int tplg_parse_routes(snd_tplg_t *tplg, snd_config_t *cfg)
+static int tplg_parse_routes(snd_tplg_t *tplg, snd_config_t *cfg, int index)
{
snd_config_iterator_t i, next;
snd_config_t *n;
@@ -399,7 +399,7 @@ static int tplg_parse_routes(snd_tplg_t *tplg, snd_config_t *cfg)
elem = tplg_elem_new_route(tplg);
if (!elem)
return -ENOMEM;
-
+ elem->index = index;
line = elem->route;
err = tplg_parse_line(val, line);
@@ -419,7 +419,8 @@ int tplg_parse_dapm_graph(snd_tplg_t *tplg, snd_config_t *cfg,
snd_config_iterator_t i, next;
snd_config_t *n;
int err;
- const char *graph_id;
+ const char *graph_id, *val = NULL;
+ int index;
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("error: compound is expected for dapm graph definition\n");
@@ -436,8 +437,14 @@ int tplg_parse_dapm_graph(snd_tplg_t *tplg, snd_config_t *cfg,
continue;
}
+ if (strcmp(id, "index") == 0) {
+ if (snd_config_get_string(n, &val) < 0)
+ return -EINVAL;
+ index = atoi(val);
+ }
+
if (strcmp(id, "lines") == 0) {
- err = tplg_parse_routes(tplg, n);
+ err = tplg_parse_routes(tplg, n, index);
if (err < 0) {
SNDERR("error: failed to parse dapm graph %s\n",
graph_id);
--
2.7.4
next reply other threads:[~2017-05-05 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 7:57 fuweix.tang [this message]
2017-05-05 8:09 ` [PATCH v2] topology: Fix issue in parsing routes when generating topology binary Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1493971040-15628-1-git-send-email-fuweix.tang@intel.com \
--to=fuweix.tang@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=mengdong.lin@intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.