mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added SND_CTL_READONLY
This commit is contained in:
parent
098932ce57
commit
7fcea07002
3 changed files with 7 additions and 3 deletions
|
|
@ -180,6 +180,9 @@ typedef enum _snd_ctl_type {
|
||||||
/** Async notification (flag for open mode) \hideinitializer */
|
/** Async notification (flag for open mode) \hideinitializer */
|
||||||
#define SND_CTL_ASYNC 0x0002
|
#define SND_CTL_ASYNC 0x0002
|
||||||
|
|
||||||
|
/** Read only (flag for open mode) \hideinitializer */
|
||||||
|
#define SND_CTL_READONLY 0x0004
|
||||||
|
|
||||||
/** CTL handle */
|
/** CTL handle */
|
||||||
typedef struct _snd_ctl snd_ctl_t;
|
typedef struct _snd_ctl snd_ctl_t;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,10 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
||||||
|
|
||||||
assert(card >= 0 && card < 32);
|
assert(card >= 0 && card < 32);
|
||||||
sprintf(filename, SNDRV_FILE_CONTROL, card);
|
sprintf(filename, SNDRV_FILE_CONTROL, card);
|
||||||
fmode = O_RDWR;
|
if (mode & SND_CTL_READONLY)
|
||||||
|
fmode = O_RDONLY;
|
||||||
|
else
|
||||||
|
fmode = O_RDWR;
|
||||||
if (mode & SND_CTL_NONBLOCK)
|
if (mode & SND_CTL_NONBLOCK)
|
||||||
fmode |= O_NONBLOCK;
|
fmode |= O_NONBLOCK;
|
||||||
if (mode & SND_CTL_ASYNC)
|
if (mode & SND_CTL_ASYNC)
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ struct snd_dlsym_link *snd_dlsym_start = NULL;
|
||||||
*/
|
*/
|
||||||
void *snd_dlopen(const char *name, int mode)
|
void *snd_dlopen(const char *name, int mode)
|
||||||
{
|
{
|
||||||
void *res;
|
|
||||||
|
|
||||||
#ifndef PIC
|
#ifndef PIC
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
return &snd_dlsym_start;
|
return &snd_dlsym_start;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue