From 59de61e5b5b960ec979c0ff4ede72cdc28a2d424 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 15 Aug 2012 17:05:37 +0200 Subject: [PATCH] PCM: Allow to run older version of extplug plugin Also show the incompatible plugin version number in error messages. Signed-off-by: Takashi Iwai --- src/pcm/pcm_extplug.c | 9 ++++++--- 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; } -- 2.47.1