mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Fixed small bug in open()...
This commit is contained in:
parent
fbd6ad14bf
commit
ea5cdff6f5
4 changed files with 14 additions and 6 deletions
|
|
@ -50,8 +50,10 @@ int snd_ctl_open( void **handle, int card )
|
||||||
close( fd );
|
close( fd );
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_CTL_VERSION_MAX ) )
|
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_CTL_VERSION_MAX ) ) {
|
||||||
|
close( fd );
|
||||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||||
|
}
|
||||||
ctl = (snd_ctl_t *)calloc( 1, sizeof( snd_ctl_t ) );
|
ctl = (snd_ctl_t *)calloc( 1, sizeof( snd_ctl_t ) );
|
||||||
if ( ctl == NULL ) {
|
if ( ctl == NULL ) {
|
||||||
close( fd );
|
close( fd );
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include "asoundlib.h"
|
#include "asoundlib.h"
|
||||||
|
|
||||||
#define SND_FILE_MIXER "/dev/snd/mixer%i%i"
|
#define SND_FILE_MIXER "/dev/snd/mixer%i%i"
|
||||||
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 1 )
|
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION( 1, 1, 0 )
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int card;
|
int card;
|
||||||
|
|
@ -51,8 +51,10 @@ int snd_mixer_open( void **handle, int card, int device )
|
||||||
close( fd );
|
close( fd );
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_MIXER_VERSION_MAX ) )
|
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_MIXER_VERSION_MAX ) ) {
|
||||||
|
close( fd );
|
||||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||||
|
}
|
||||||
mixer = (snd_mixer_t *)calloc( 1, sizeof( snd_mixer_t ) );
|
mixer = (snd_mixer_t *)calloc( 1, sizeof( snd_mixer_t ) );
|
||||||
if ( mixer == NULL ) {
|
if ( mixer == NULL ) {
|
||||||
close( fd );
|
close( fd );
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include "asoundlib.h"
|
#include "asoundlib.h"
|
||||||
|
|
||||||
#define SND_FILE_PCM "/dev/snd/pcm%i%i"
|
#define SND_FILE_PCM "/dev/snd/pcm%i%i"
|
||||||
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
|
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 1 )
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int card;
|
int card;
|
||||||
|
|
@ -51,8 +51,10 @@ int snd_pcm_open( void **handle, int card, int device, int mode )
|
||||||
close( fd );
|
close( fd );
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_PCM_VERSION_MAX ) )
|
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_PCM_VERSION_MAX ) ) {
|
||||||
|
close( fd );
|
||||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||||
|
}
|
||||||
pcm = (snd_pcm_t *)calloc( 1, sizeof( snd_pcm_t ) );
|
pcm = (snd_pcm_t *)calloc( 1, sizeof( snd_pcm_t ) );
|
||||||
if ( pcm == NULL ) {
|
if ( pcm == NULL ) {
|
||||||
close( fd );
|
close( fd );
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,10 @@ int snd_rawmidi_open( void **handle, int card, int device, int mode )
|
||||||
close( fd );
|
close( fd );
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_PCM_VERSION_MAX ) )
|
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_PCM_VERSION_MAX ) ) {
|
||||||
|
close( fd );
|
||||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||||
|
}
|
||||||
rmidi = (snd_rawmidi_t *)calloc( 1, sizeof( snd_rawmidi_t ) );
|
rmidi = (snd_rawmidi_t *)calloc( 1, sizeof( snd_rawmidi_t ) );
|
||||||
if ( rmidi == NULL ) {
|
if ( rmidi == NULL ) {
|
||||||
close( fd );
|
close( fd );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue