2.02.01 - bug in registerCodec?

I appear to have run into a bug while experimenting with custom codecs earlier today: calling registerCodec always seems to return FMOD_ERR_PLUGIN_VERSION, regardless of whether the apiversion field of the given FMOD_CODEC_DESCRIPTION struct is set to FMOD_CODEC_PLUGIN_VERSION or not. Interestingly though, custom codecs seem to work fine when loaded as a separate DLL via loadPlugin.
I’ve managed to reproduce this with both my own codec plugin and the included fmod_codec_raw.cpp example (completely unmodified), with both MSYS2 MinGW and VS 2019.

Is this a bug or have I managed to miss something here?

Thanks for flagging this, it looks like the registerCodec call hasn’t been updated to copy the apiversion field which was added to FMOD_CODEC_DESCRIPTION fairly recently.
I’ll make a task for the dev team to fix that for a later release, in the meantime loadPlugin is working fine with dlls (as you’ve noticed) so hopefully that doesn’t get too inconvenient until we’ve got a fix.

1 Like

Fortunately the inconvenience isn’t much more than writing a few more lines of CMake so I can deal with this workaround for now :smiley:
Thanks for confirming and raising this, greatly appreciated!