summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-06-25 23:16:14 +0200
committerTakashi Iwai <tiwai@suse.de>2012-06-25 23:16:14 +0200
commit52160de21ee6a710a746b0881d9581994d039123 (patch)
tree25da6f95cf950008db3e20f70921fb68a080cbdf
parente8923f2e7569cc390129572bfbd6552cbb407207 (diff)
downloadalsa-lib-52160de21ee6a710a746b0881d9581994d039123.tar.gz
Fix the binary compatibility of ext-ctl plugin with protocol 1.0.0
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/control_external.h9
-rw-r--r--src/control/control_ext.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/include/control_external.h b/include/control_external.h
index 5392ea69..e98f4d6d 100644
--- a/include/control_external.h
+++ b/include/control_external.h
@@ -125,16 +125,17 @@ struct snd_ctl_ext {
* control handle filled by #snd_ctl_ext_create()
*/
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 {
snd_ctl_ext_tlv_rw_t *c;
const unsigned int *p;
} tlv;
-
- int nonblock; /**< non-block mode; read-only */
- int subscribed; /**< events subscribed; read-only */
};
/** Callback table of ext */
diff --git a/src/control/control_ext.c b/src/control/control_ext.c
index cc307668..56552fa1 100644
--- a/src/control/control_ext.c
+++ b/src/control/control_ext.c
@@ -706,7 +706,8 @@ int snd_ctl_ext_create(snd_ctl_ext_t *ext, const char *name, int mode)
snd_ctl_t *ctl;
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");
return -ENXIO;
}