[SoftCSA] Skip CSA session setup when libdvbcsa is missing

Status
Not open for further replies.

GitHub

Moderator
[SoftCSA] Skip CSA session setup when libdvbcsa is missing

Without libdvbcsa software descrambling is impossible. The previous code
still created eDVBCSASession + eDVBCSAEngine on every encrypted Live-TV
tune, recording start and stream start. Init() failed inside the engine,
logged "csa_load_library failed" and "Failed to initialize CSA session"
per attempt, and freed the objects again -- visible as recurring warning
spam on boxes without libdvbcsa.

Add an eDVBCSAEngine::isAvailable() early return at the four entry points
(setupSpeculativeDescrambling for Live-TV, setupSoftwareDescrambler for
recording, setupSpeculativeDescrambler for streaming; the timeshift path
is implicitly covered because it gates on the live m_csa_session being
active).

isAvailable() is the existing static lazy-loader -- first call triggers
the single dlopen attempt, all subsequent calls are an O(1) flag check.

Net effect on libdvbcsa-less boxes:
- exactly one "libdvbcsa not found" warning at the first encrypted service
- zero allocations and zero further log lines for SoftCSA from then on
- unchanged guard semantics in callers (m_csa_session stays nullptr)

(cherry picked from commit 1bc7dd7795f11266cc229cd72a449b5072f355cf)

Continue reading...
 
Status
Not open for further replies.
Back
Top