mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
New updated mixer interface and better protocol handling...
This commit is contained in:
parent
e093a81e5e
commit
44582b2fbe
7 changed files with 63 additions and 18 deletions
|
|
@ -12,7 +12,7 @@
|
|||
#include "soundlib.h"
|
||||
|
||||
#define SND_FILE_PCM "/dev/sndpcm%i%i"
|
||||
#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
|
||||
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 )
|
||||
|
||||
typedef struct {
|
||||
int card;
|
||||
|
|
@ -34,7 +34,8 @@ int snd_pcm_open( void **handle, int card, int device, int mode )
|
|||
close( fd );
|
||||
return -errno;
|
||||
}
|
||||
if ( ver > SND_CTL_VERSION_MAX ) return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
if ( SND_PROTOCOL_UNCOMPATIBLE( ver, SND_PCM_VERSION_MAX ) )
|
||||
return -SND_ERROR_UNCOMPATIBLE_VERSION;
|
||||
pcm = (snd_pcm_t *)calloc( 1, sizeof( snd_pcm_t ) );
|
||||
if ( pcm == NULL ) {
|
||||
close( fd );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue