mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-04-14 02:45:07 +00:00
refactor(dab): extract sdr_id/center_freq before try block in _getDemodulator
Avoids calling getId() and props["center_freq"] twice — previously if the second call raised after acquire() succeeded, the refcount would leak. In practice both calls are infallible, but extracting them is cleaner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7043356121
commit
fa66bb44c4
1 changed files with 4 additions and 6 deletions
10
owrx/dsp.py
10
owrx/dsp.py
|
|
@ -586,13 +586,11 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
elif demod == "dab":
|
||||
from csdr.chain.dablin import Dablin
|
||||
from owrx.dab.manager import DabDecoderManager
|
||||
sdr_id = self.sdrSource.getId()
|
||||
center_freq = self.props["center_freq"]
|
||||
try:
|
||||
shared = DabDecoderManager.getShared().acquire(
|
||||
self.sdrSource.getId(),
|
||||
self.props["center_freq"],
|
||||
self.sdrSource,
|
||||
)
|
||||
self._dabKey = (self.sdrSource.getId(), self.props["center_freq"])
|
||||
shared = DabDecoderManager.getShared().acquire(sdr_id, center_freq, self.sdrSource)
|
||||
self._dabKey = (sdr_id, center_freq)
|
||||
return Dablin(shared_decoder=shared)
|
||||
except Exception:
|
||||
logger.exception("Shared DAB decoder failed, falling back to standalone")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue