[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:
@@ -110,7 +110,8 @@ fn run_capture(
|
|||||||
let mut capturing = false;
|
let mut capturing = false;
|
||||||
|
|
||||||
loop {
|
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 {
|
if has_receivers && !capturing {
|
||||||
let _ = stream.play();
|
let _ = stream.play();
|
||||||
|
|||||||
Reference in New Issue
Block a user