feat: enable adaptive frame dropping only for device-based audio inputs
This commit is contained in:
@@ -174,7 +174,14 @@ class StreamerWorker:
|
||||
|
||||
# overwrite some configurations
|
||||
conf.transport = TRANSPORT1
|
||||
conf.enable_drift_compensation=True
|
||||
# Enable adaptive frame dropping only for device-based inputs (not file/demo)
|
||||
try:
|
||||
conf.enable_adaptive_frame_dropping = any(
|
||||
isinstance(big.audio_source, str) and big.audio_source.startswith('device:')
|
||||
for big in conf.bigs
|
||||
)
|
||||
except Exception:
|
||||
conf.enable_adaptive_frame_dropping = False
|
||||
# Derive device name and input mode
|
||||
first_source = conf.bigs[0].audio_source if conf.bigs else ''
|
||||
input_device_name = None
|
||||
@@ -242,6 +249,14 @@ class StreamerWorker:
|
||||
self._multicaster2 = None
|
||||
|
||||
conf.transport = TRANSPORT2
|
||||
# Enable adaptive frame dropping only for device-based inputs (not file/demo)
|
||||
try:
|
||||
conf.enable_adaptive_frame_dropping = any(
|
||||
isinstance(big.audio_source, str) and big.audio_source.startswith('device:')
|
||||
for big in conf.bigs
|
||||
)
|
||||
except Exception:
|
||||
conf.enable_adaptive_frame_dropping = False
|
||||
for big in conf.bigs:
|
||||
if big.audio_source.startswith('device:'):
|
||||
device_name = big.audio_source.split(':', 1)[1]
|
||||
|
||||
Reference in New Issue
Block a user