diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-14 12:19:48 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-21 16:23:54 -0400 |
commit | d40a598970b04bfe3a867a5e12debc45c149b46b (patch) | |
tree | 26e974f910f7d3047adfbc536d8e10c2d973b7e9 /apps/codecs.c | |
parent | 2fb2364686e5470437f0ee3d214662d51067eb90 (diff) | |
download | rockbox-d40a598970b04bfe3a867a5e12debc45c149b46b.tar.gz rockbox-d40a598970b04bfe3a867a5e12debc45c149b46b.zip |
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
Diffstat (limited to 'apps/codecs.c')
-rw-r--r-- | apps/codecs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/codecs.c b/apps/codecs.c index 4d2dd34ce0..9f34d26e14 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -203,8 +203,9 @@ static int codec_load_ram(struct codec_api *api) | |||
203 | return CODEC_ERROR; | 203 | return CODEC_ERROR; |
204 | } | 204 | } |
205 | 205 | ||
206 | if (hdr->api_version > CODEC_API_VERSION | 206 | if (hdr->api_version != CODEC_API_VERSION || |
207 | || hdr->api_version < CODEC_MIN_API_VERSION) { | 207 | c_hdr->api_size > sizeof(struct codec_api)) |
208 | { | ||
208 | logf("codec api version error"); | 209 | logf("codec api version error"); |
209 | lc_close(curr_handle); | 210 | lc_close(curr_handle); |
210 | curr_handle = NULL; | 211 | curr_handle = NULL; |