mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Set PCM name properly in empty and asym plugins
The PCM name isn't set properly on empty and asym plugins due to its call of snd_pcm_open_slave(). Now a new function snd_pcm_open_named_slave() is created and make snd_pcm_open_slave() an inline function calling the new one with name=NULL.
This commit is contained in:
parent
a2d98ebd42
commit
72ede8a12d
4 changed files with 21 additions and 9 deletions
|
|
@ -2226,9 +2226,10 @@ int snd_pcm_free(snd_pcm_t *pcm)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root,
|
int snd_pcm_open_named_slave(snd_pcm_t **pcmp, const char *name,
|
||||||
snd_config_t *conf, snd_pcm_stream_t stream,
|
snd_config_t *root,
|
||||||
int mode, snd_config_t *parent_conf)
|
snd_config_t *conf, snd_pcm_stream_t stream,
|
||||||
|
int mode, snd_config_t *parent_conf)
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
int hop;
|
int hop;
|
||||||
|
|
@ -2238,7 +2239,7 @@ int snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root,
|
||||||
if (snd_config_get_string(conf, &str) >= 0)
|
if (snd_config_get_string(conf, &str) >= 0)
|
||||||
return snd_pcm_open_noupdate(pcmp, root, str, stream, mode,
|
return snd_pcm_open_noupdate(pcmp, root, str, stream, mode,
|
||||||
hop + 1);
|
hop + 1);
|
||||||
return snd_pcm_open_conf(pcmp, NULL, root, conf, stream, mode);
|
return snd_pcm_open_conf(pcmp, name, root, conf, stream, mode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,8 @@ int _snd_pcm_asym_open(snd_pcm_t **pcmp, const char *name ATTRIBUTE_UNUSED,
|
||||||
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
|
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
err = snd_pcm_open_slave(pcmp, root, sconf, stream, mode, conf);
|
err = snd_pcm_open_named_slave(pcmp, name, root, sconf, stream,
|
||||||
|
mode, conf);
|
||||||
snd_config_delete(sconf);
|
snd_config_delete(sconf);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,8 @@ int _snd_pcm_empty_open(snd_pcm_t **pcmp, const char *name ATTRIBUTE_UNUSED,
|
||||||
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
|
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
err = snd_pcm_open_slave(pcmp, root, sconf, stream, mode, conf);
|
err = snd_pcm_open_named_slave(pcmp, name, root, sconf, stream,
|
||||||
|
mode, conf);
|
||||||
snd_config_delete(sconf);
|
snd_config_delete(sconf);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -749,9 +749,18 @@ int snd_pcm_slave_conf(snd_config_t *root, snd_config_t *conf,
|
||||||
|
|
||||||
#define SND_PCM_APPEND (1<<8)
|
#define SND_PCM_APPEND (1<<8)
|
||||||
|
|
||||||
int snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root,
|
int snd_pcm_open_named_slave(snd_pcm_t **pcmp, const char *name,
|
||||||
snd_config_t *conf, snd_pcm_stream_t stream,
|
snd_config_t *root,
|
||||||
int mode, snd_config_t *parent_conf);
|
snd_config_t *conf, snd_pcm_stream_t stream,
|
||||||
|
int mode, snd_config_t *parent_conf);
|
||||||
|
static inline int
|
||||||
|
snd_pcm_open_slave(snd_pcm_t **pcmp, snd_config_t *root,
|
||||||
|
snd_config_t *conf, snd_pcm_stream_t stream,
|
||||||
|
int mode, snd_config_t *parent_conf)
|
||||||
|
{
|
||||||
|
return snd_pcm_open_named_slave(pcmp, NULL, root, conf, stream,
|
||||||
|
mode, parent_conf);
|
||||||
|
}
|
||||||
int snd_pcm_conf_generic_id(const char *id);
|
int snd_pcm_conf_generic_id(const char *id);
|
||||||
|
|
||||||
int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name, int fd, int mmap_emulation, int sync_ptr_ioctl);
|
int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name, int fd, int mmap_emulation, int sync_ptr_ioctl);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue