mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
control: remap - assign right name to the child handle for no-op (2nd case)
Fixes: https://github.com/alsa-project/alsa-utils/issues/100 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
e47c11822d
commit
23a191a82c
1 changed files with 5 additions and 5 deletions
|
|
@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
|
||||||
snd_ctl_t *ctl;
|
snd_ctl_t *ctl;
|
||||||
int result, err;
|
int result, err;
|
||||||
|
|
||||||
|
/* no-op, remove the plugin */
|
||||||
|
if (!remap && !map)
|
||||||
|
goto _noop;
|
||||||
|
|
||||||
priv = calloc(1, sizeof(*priv));
|
priv = calloc(1, sizeof(*priv));
|
||||||
if (priv == NULL)
|
if (priv == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema
|
||||||
/* no-op check, remove the plugin */
|
/* no-op check, remove the plugin */
|
||||||
if (priv->map_items == 0 && priv->remap_items == 0) {
|
if (priv->map_items == 0 && priv->remap_items == 0) {
|
||||||
remap_free(priv);
|
remap_free(priv);
|
||||||
|
_noop:
|
||||||
free(child->name);
|
free(child->name);
|
||||||
child->name = name ? strdup(name) : NULL;
|
child->name = name ? strdup(name) : NULL;
|
||||||
if (name && !child->name)
|
if (name && !child->name)
|
||||||
|
|
@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd
|
||||||
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
|
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
/* no-op, remove the plugin */
|
|
||||||
if (!remap && !map) {
|
|
||||||
*handlep = cctl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode);
|
err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
snd_ctl_close(cctl);
|
snd_ctl_close(cctl);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue