diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-15 17:05:37 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-15 17:05:37 +0200 |
commit | 59de61e5b5b960ec979c0ff4ede72cdc28a2d424 (patch) | |
tree | bd387025f7c8fc3d3aba2c21e838d2479fd62b04 | |
parent | d0ca075621074a9b35eefbe27328245c9ae9eead (diff) | |
download | alsa-lib-59de61e5b5b960ec979c0ff4ede72cdc28a2d424.tar.gz |
PCM: Allow to run older version of extplug plugin
Also show the incompatible plugin version number in error messages.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/pcm/pcm_extplug.c | 9 | ||||
-rw-r--r-- | src/pcm/pcm_ioplug.c | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/pcm/pcm_extplug.c b/src/pcm/pcm_extplug.c index a34706ff..289fc781 100644 --- a/src/pcm/pcm_extplug.c +++ b/src/pcm/pcm_extplug.c @@ -641,8 +641,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"); + /* We support 1.0.0 to current */ + if (extplug->version < 0x010000 || + extplug->version > SND_PCM_EXTPLUG_VERSION) { + SNDERR("extplug: Plugin version mismatch: 0x%x\n", + extplug->version); return -ENXIO; } @@ -668,7 +671,7 @@ int snd_pcm_extplug_create(snd_pcm_extplug_t *extplug, const char *name, ext->plug.undo_write = snd_pcm_plugin_undo_write_generic; ext->plug.gen.slave = spcm; ext->plug.gen.close_slave = 1; - if (extplug->callback->init) + if (extplug->version >= 0x010001 && extplug->callback->init) ext->plug.init = snd_pcm_extplug_init; err = snd_pcm_new(&pcm, SND_PCM_TYPE_EXTPLUG, name, stream, mode); diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c index 2aa75727..55be62d2 100644 --- a/src/pcm/pcm_ioplug.c +++ b/src/pcm/pcm_ioplug.c @@ -917,7 +917,8 @@ int snd_pcm_ioplug_create(snd_pcm_ioplug_t *ioplug, const char *name, /* We support 1.0.0 to current */ if (ioplug->version < 0x010000 || ioplug->version > SND_PCM_IOPLUG_VERSION) { - SNDERR("ioplug: Plugin version mismatch\n"); + SNDERR("ioplug: Plugin version mismatch: 0x%x\n", + ioplug->version); return -ENXIO; } |