OSDN Git Service

topology: Use bool parser to parse boolean value
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 17 Apr 2020 16:47:47 +0000 (12:47 -0400)
committerJaroslav Kysela <perex@perex.cz>
Thu, 30 Apr 2020 12:21:29 +0000 (14:21 +0200)
It should be safe to change this as correct values with int would be 0
or 1 and bool parser handles them correctly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/topology/dapm.c

index 7064512..cd1a877 100644 (file)
@@ -595,7 +595,8 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg,
                }
 
                if (strcmp(id, "invert") == 0) {
-                       if (tplg_get_integer(n, &ival, 0))
+                       ival = snd_config_get_bool(n);
+                       if (ival < 0)
                                return -EINVAL;
 
                        widget->invert = ival;