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

[cmakelists] Symbol visibility hidden (-fvisibility=hidden) #1706

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

CastagnaIT
Copy link
Collaborator

@CastagnaIT CastagnaIT commented Oct 22, 2024

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

static CSrvBroker* GetInstance()
{
static CSrvBroker instance;
return &instance;
}

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 globally

side 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,

  1. play widevine video
  2. play clearkey video
  3. the second video must be played without problem

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue Component: Build v22 Piers labels Oct 22, 2024
@CastagnaIT CastagnaIT merged commit b0130e9 into xbmc:Piers Oct 28, 2024
10 checks passed
@CastagnaIT CastagnaIT deleted the symbols_visibility branch October 28, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant