[fix](trx-server): start audio capture when decoder tasks are subscribed

The capture thread only checked Opus broadcast subscribers to decide
whether to start cpal input. PCM tap subscribers (APRS/CW decoders)
were not considered, so decoding never started without a browser
audio client. Include pcm_tx receiver count in the has_receivers
check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-02-08 22:37:53 +01:00
parent 3dd02d4208
commit 04706151b1
+2 -1
View File
@@ -110,7 +110,8 @@ fn run_capture(
let mut capturing = false;
loop {
let has_receivers = tx.receiver_count() > 0;
let has_receivers = tx.receiver_count() > 0
|| pcm_tx.as_ref().map_or(false, |p| p.receiver_count() > 0);
if has_receivers && !capturing {
let _ = stream.play();