From e3378d5f49481ee81c446c14d39300d4d94dcf99 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Fri, 6 Mar 2026 16:01:31 +0100 Subject: [PATCH] [fix](trx-client): start decode collector before audio replay Co-authored-by: OpenAI Codex Signed-off-by: Stan Grams --- src/trx-client/src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/trx-client/src/main.rs b/src/trx-client/src/main.rs index fc2e3ed..4bc0082 100644 --- a/src/trx-client/src/main.rs +++ b/src/trx-client/src/main.rs @@ -328,6 +328,15 @@ async fn async_init() -> DynResult { let frontend_runtime_ctx = Arc::new(frontend_runtime); + // Start decode history collector before audio client starts replay. + // Frontend tasks are spawned asynchronously, so starting the collector + // here avoids missing the initial server-side history burst. + if cfg.frontends.audio.enabled { + trx_frontend_http::server::audio::start_decode_history_collector( + frontend_runtime_ctx.clone(), + ); + } + // Spawn frontends with runtime context for frontend in &frontends { let frontend_state_rx = state_rx.clone();