forked from len0rd/rockbox
plugins: Simplify plugin/codec API versioning
Replace the minimum version bound with a check on the size of the API struct. The version only needs to be incremented for ABI breaking changes. Additions to the API won't need to touch the version number, resulting in fewer merge conflicts. Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f
This commit is contained in:
parent
2fb2364686
commit
d40a598970
7 changed files with 49 additions and 37 deletions
|
@ -203,8 +203,9 @@ static int codec_load_ram(struct codec_api *api)
|
|||
return CODEC_ERROR;
|
||||
}
|
||||
|
||||
if (hdr->api_version > CODEC_API_VERSION
|
||||
|| hdr->api_version < CODEC_MIN_API_VERSION) {
|
||||
if (hdr->api_version != CODEC_API_VERSION ||
|
||||
c_hdr->api_size > sizeof(struct codec_api))
|
||||
{
|
||||
logf("codec api version error");
|
||||
lc_close(curr_handle);
|
||||
curr_handle = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue