[cmakelists] Symbol visibility hidden (-fvisibility=hidden) #1706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
User noticed weird behaviour under linux only
when you play a widevine video and after a clearkey video this last one dont works anymore resulting in various errors,
this is only an example but the problem is reproducible in several similar ways with different DRM's
the problem are the static variables, in particular there is a singleton, the service broker
inputstream.adaptive/src/SrvBroker.h
Lines 59 to 63 in 6800302
then problem raise because shared libraries under linux (opened by kodi core with dlopen/dlclose) by default export static data in order to be shared/linked to all instances of the library, this cause that the second time that you play a video the service broker contains the data of the first video played and so cause any kind of weirdness, errors, etc...
this problem under Windows dont happens because by default symbols are internal (hidden)
there are different ways to "hide" symbols i chosen to add compiler parameter
-fvisibility=hidden
to apply it globallyside note:
im not sure because i have not time to test it on a LibreELEC device but there is possibility that could fix #454 about "Permanent failure" error, see comment #727 (comment), where seem that widevine library could have static variables
Motivation and context
fix #1704
How has this been tested?
builded on ubuntu then,
Screenshots (if appropriate):
Types of change
Checklist: