Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Codec list gets duplicated when using SAIL_ONLY_CODECS #103

Closed
JoniSt opened this issue Aug 18, 2021 · 2 comments · Fixed by #106
Closed

Bug: Codec list gets duplicated when using SAIL_ONLY_CODECS #103

JoniSt opened this issue Aug 18, 2021 · 2 comments · Fixed by #106
Labels
bug Something isn't working

Comments

@JoniSt
Copy link

JoniSt commented Aug 18, 2021

Hi again,

I've found a minor bug in SAIL's cmake build scripts. Defining SAIL_ONLY_CODECS (or SAIL_EXCEPT_CODECS) causes the list of codecs to get duplicated like this:

~/sail/build$ cmake -DCMAKE_BUILD_TYPE=Debug -DSAIL_ONLY_CODECS="png;jpeg;bmp" ..
***************************************
*
* Configuration statistics:
(...snip...)
* Enabled codecs:              BMP,JPEG,PNG,BMP,JPEG,PNG

This in turn causes SAIL to load all codecs twice when using SAIL_FLAG_PRELOAD_CODECS.

I've managed to track the bug down: cmake/sail_codec.cmake gets called for every enabled codec and adds them to the SAIL_ENABLED_CODECS list; however, src/sail-codecs/CMakeLists.txt also adds every enabled codec to that list. The latter probably shouldn't populate the list.

Here's a simple patch that fixes the bug. I've just renamed the temporary variable that the ONLY_CODECS/EXCEPT_CODECS code uses so it doesn't collide with the list that sail_codec.cmake generates anymore.

Thank you for your great work on this awesome library!

@HappySeaFox HappySeaFox added the bug Something isn't working label Aug 18, 2021
@HappySeaFox
Copy link
Owner

HappySeaFox commented Aug 18, 2021

@JoniSt Fix has been commited in feature/fix-sail-only-codecs-2. Please check it works as expected. On my side I checked it with different combinations of SAIL_ONLY_CODECS and SAIL_EXCEPT_CODECS, it looks good.

@JoniSt
Copy link
Author

JoniSt commented Aug 18, 2021

Works great in my project too, codecs are now loaded only once. Thank you for the super quick fix!

HappySeaFox pushed a commit that referenced this issue Aug 19, 2021
SAIL: Fix duplicating ENABLED_CODECS and empty DISABLED_CODECS #103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants