]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix snd_pcm_open_noupdate() to refer alias
authorTakashi Iwai <tiwai@suse.de>
Wed, 4 Oct 2006 15:32:22 +0000 (17:32 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 4 Oct 2006 15:32:22 +0000 (17:32 +0200)
Fixed snd_pcm_open_noupdate() to refer alias.  This fixes the call like

% aplay -Dplug:bah

where bah is an alias of a certain definition.

src/pcm/pcm.c

index 15125923007356d2e12582cd0808e0bfbcd6af9a..eaf1a19e595ab12bff389c84cfb65265b031058e 100644 (file)
@@ -2138,13 +2138,20 @@ static int snd_pcm_open_noupdate(snd_pcm_t **pcmp, snd_config_t *root,
 {
        int err;
        snd_config_t *pcm_conf;
+       const char *str;
+
        err = snd_config_search_definition(root, "pcm", name, &pcm_conf);
        if (err < 0) {
                SNDERR("Unknown PCM %s", name);
                return err;
        }
-       snd_config_set_hop(pcm_conf, hop);
-       err = snd_pcm_open_conf(pcmp, name, root, pcm_conf, stream, mode);
+       if (snd_config_get_string(pcm_conf, &str) >= 0)
+               err = snd_pcm_open_noupdate(pcmp, root, str, stream, mode,
+                                           hop + 1);
+       else {
+               snd_config_set_hop(pcm_conf, hop);
+               err = snd_pcm_open_conf(pcmp, name, root, pcm_conf, stream, mode);
+       }
        snd_config_delete(pcm_conf);
        return err;
 }