mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
initialize the running mode (if exists).
This commit is contained in:
parent
5541c7a31e
commit
84730c976f
1 changed files with 22 additions and 0 deletions
|
|
@ -504,6 +504,28 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
|
||||||
return client;
|
return client;
|
||||||
} else
|
} else
|
||||||
seq->client = client;
|
seq->client = client;
|
||||||
|
|
||||||
|
#ifdef SNDRV_SEQ_IOCTL_RUNNING_MODE
|
||||||
|
{
|
||||||
|
struct sndrv_seq_running_info run_mode;
|
||||||
|
/* check running mode */
|
||||||
|
memset(&run_mode, 0, sizeof(run_mode));
|
||||||
|
run_mode.client = client;
|
||||||
|
#ifdef SNDRV_BIG_ENDIAN
|
||||||
|
run_mode.big_endian = 1;
|
||||||
|
#else
|
||||||
|
run_mode.big_endian = 0;
|
||||||
|
#endif
|
||||||
|
run_mode.cpu_mode = sizeof(long);
|
||||||
|
if (ioctl(fd, SNDRV_SEQ_IOCTL_RUNNING_MODE, &run_mode) < 0) {
|
||||||
|
int err = errno;
|
||||||
|
SYSERR("Invalid OS running mode");
|
||||||
|
snd_seq_close(seq);
|
||||||
|
return -err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
*handle = seq;
|
*handle = seq;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue