]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix the binary compatibility of ext-ctl plugin with protocol 1.0.0
authorTakashi Iwai <tiwai@suse.de>
Mon, 25 Jun 2012 21:16:14 +0000 (23:16 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 25 Jun 2012 21:16:14 +0000 (23:16 +0200)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/control_external.h
src/control/control_ext.c

index 5392ea691e3d885bb6e8591ce4fef036938b4ef0..e98f4d6df34a7bfce1f7fc14645202f6f27811b2 100644 (file)
@@ -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 */
index cc307668166936dd5ccdb581d15d4bb8e9f4ee27..56552fa1aa0ef0e6383abf4029b63944a841c2c4 100644 (file)
@@ -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;
        }