mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-11-26 17:21:07 +00:00
More mixer updates and some fixes...
This commit is contained in:
parent
f32c1b4f60
commit
30e978b0b8
@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
#define SND_ERROR_BEGIN 500000
|
||||
#define SND_ERROR_UNCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0)
|
||||
#define SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -57,9 +57,9 @@ int snd_ctl_open(snd_ctl_t **handle, int card)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_CTL_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_CTL_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
ctl = (snd_ctl_t *) calloc(1, sizeof(snd_ctl_t));
|
||||
if (ctl == NULL) {
|
||||
|
@ -57,9 +57,9 @@ int snd_mixer_open(snd_mixer_t **handle, int card, int device)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_MIXER_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_MIXER_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
mixer = (snd_mixer_t *) calloc(1, sizeof(snd_mixer_t));
|
||||
if (mixer == NULL) {
|
||||
|
@ -57,9 +57,9 @@ int snd_pcm_open(snd_pcm_t **handle, int card, int device, int mode)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_PCM_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_PCM_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
pcm = (snd_pcm_t *) calloc(1, sizeof(snd_pcm_t));
|
||||
if (pcm == NULL) {
|
||||
|
@ -58,9 +58,9 @@ int snd_pcm_loopback_open(snd_pcm_loopback_t **handle, int card, int device, int
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_PCM_LB_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_PCM_LB_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
lb = (snd_pcm_loopback_t *) calloc(1, sizeof(snd_pcm_loopback_t));
|
||||
if (lb == NULL) {
|
||||
|
@ -57,9 +57,9 @@ int snd_rawmidi_open(snd_rawmidi_t **handle, int card, int device, int mode)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_RAWMIDI_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_RAWMIDI_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
rmidi = (snd_rawmidi_t *) calloc(1, sizeof(snd_rawmidi_t));
|
||||
if (rmidi == NULL) {
|
||||
|
@ -72,9 +72,9 @@ int snd_seq_open(snd_seq_t **handle, int mode)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_SEQ_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_SEQ_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
if (ioctl(fd, SND_SEQ_IOCTL_CLIENT_ID, &client) < 0) {
|
||||
close(fd);
|
||||
|
@ -51,9 +51,9 @@ int snd_timer_open(snd_timer_t **handle)
|
||||
close(fd);
|
||||
return -errno;
|
||||
}
|
||||
if (SND_PROTOCOL_UNCOMPATIBLE(ver, SND_TIMER_VERSION_MAX)) {
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_TIMER_VERSION_MAX)) {
|
||||
close(fd);
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
return -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
}
|
||||
tmr = (snd_timer_t *) calloc(1, sizeof(snd_timer_t));
|
||||
if (tmr == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user