mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Add protocl version check
- Added protocl version check. The caller of snd_pcm_{io|ext}plug_create()
must fill version field with SND_PCM_{IO|EXT}PLUG_VERSION beforehand.
- Added poll_descriptors and poll_descriptors_count callbacks for ioplug.
This commit is contained in:
parent
97010dbfdb
commit
e61d385993
4 changed files with 80 additions and 1 deletions
|
|
@ -423,6 +423,8 @@ static snd_pcm_ops_t snd_pcm_extplug_ops = {
|
|||
.dump = snd_pcm_extplug_dump,
|
||||
.nonblock = snd_pcm_generic_nonblock,
|
||||
.async = snd_pcm_generic_async,
|
||||
.poll_descriptors_count = snd_pcm_generic_poll_descriptors_count,
|
||||
.poll_descriptors = snd_pcm_generic_poll_descriptors,
|
||||
.poll_revents = snd_pcm_generic_poll_revents,
|
||||
.mmap = snd_pcm_generic_mmap,
|
||||
.munmap = snd_pcm_generic_munmap,
|
||||
|
|
@ -478,6 +480,11 @@ int snd_pcm_extplug_create(snd_pcm_extplug_t *extplug, const char *name,
|
|||
assert(extplug->callback->transfer);
|
||||
assert(slave_conf);
|
||||
|
||||
if (extplug->version != SND_PCM_EXTPLUG_VERSION) {
|
||||
SNDERR("extplug: Plugin version mismatch\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
err = snd_pcm_slave_conf(root, slave_conf, &sconf, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue