mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Added name support
This commit is contained in:
parent
5b3e5e6c74
commit
66df4a7e65
13 changed files with 77 additions and 47 deletions
|
|
@ -576,6 +576,16 @@ int snd_pcm_hw_open_device(snd_pcm_t **handlep, int card, int device, int stream
|
|||
return snd_pcm_hw_open_subdevice(handlep, card, device, -1, stream, mode);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_open(snd_pcm_t **handlep, char *name, int card, int device, int subdevice, int stream, int mode)
|
||||
{
|
||||
int err = snd_pcm_hw_open_subdevice(handlep, card, device, subdevice, stream, mode);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (name)
|
||||
(*handlep)->name = strdup(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _snd_pcm_hw_open(snd_pcm_t **pcmp, char *name, snd_config_t *conf,
|
||||
int stream, int mode)
|
||||
{
|
||||
|
|
@ -619,6 +629,6 @@ int _snd_pcm_hw_open(snd_pcm_t **pcmp, char *name, snd_config_t *conf,
|
|||
}
|
||||
if (card < 0)
|
||||
return -EINVAL;
|
||||
return snd_pcm_hw_open_subdevice(pcmp, card, device, subdevice, stream, mode);
|
||||
return snd_pcm_hw_open(pcmp, name, card, device, subdevice, stream, mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue