Fix the binary compatibility of ext-ctl plugin with protocol 1.0.0

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2012-06-25 23:16:14 +02:00
parent e8923f2e75
commit 52160de21e
2 changed files with 7 additions and 5 deletions

View file

@ -125,16 +125,17 @@ struct snd_ctl_ext {
* control handle filled by #snd_ctl_ext_create() * control handle filled by #snd_ctl_ext_create()
*/ */
snd_ctl_t *handle; snd_ctl_t *handle;
int nonblock; /**< non-block mode; read-only */
int subscribed; /**< events subscribed; read-only */
/** /**
* optional TLV data for the control. * optional TLV data for the control (since protocol 1.0.1)
*/ */
union { union {
snd_ctl_ext_tlv_rw_t *c; snd_ctl_ext_tlv_rw_t *c;
const unsigned int *p; const unsigned int *p;
} tlv; } tlv;
int nonblock; /**< non-block mode; read-only */
int subscribed; /**< events subscribed; read-only */
}; };
/** Callback table of ext */ /** Callback table of ext */

View file

@ -706,7 +706,8 @@ int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode)
snd_ctl_t *ctl; snd_ctl_t *ctl;
int err; int err;
if (ext->version != SND_CTL_EXT_VERSION) { if (ext->version < SNDRV_PROTOCOL_VERSION(1, 0, 0) ||
ext->version > SND_CTL_EXT_VERSION) {
SNDERR("ctl_ext: Plugin version mismatch\n"); SNDERR("ctl_ext: Plugin version mismatch\n");
return -ENXIO; return -ENXIO;
} }