From a04b8271cc8626f5f05c41a766621616efdca8ad Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Fri, 27 Mar 2026 18:05:10 +0400 Subject: [PATCH] fix: record mode decode-per-packet (same fix as live mode) The --record recv loop was using while-drain which exhausted the jitter buffer and stopped decoding after the first burst. Now decodes once per source packet, matching the live mode fix. Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/wzp-client/src/cli.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/wzp-client/src/cli.rs b/crates/wzp-client/src/cli.rs index b47cc8c..3dfd786 100644 --- a/crates/wzp-client/src/cli.rs +++ b/crates/wzp-client/src/cli.rs @@ -325,16 +325,19 @@ async fn run_file_mode( result = recv_transport.recv_media() => { match result { Ok(Some(pkt)) => { + let is_repair = pkt.header.is_repair; decoder.ingest(pkt); - while let Some(n) = decoder.decode_next(&mut pcm_buf) { - all_pcm.extend_from_slice(&pcm_buf[..n]); - frames_received += 1; - if frames_received % 250 == 0 { - info!( - frames = frames_received, - samples = all_pcm.len(), - "recv progress" - ); + if !is_repair { + if let Some(n) = decoder.decode_next(&mut pcm_buf) { + all_pcm.extend_from_slice(&pcm_buf[..n]); + frames_received += 1; + if frames_received % 250 == 0 { + info!( + frames = frames_received, + samples = all_pcm.len(), + "recv progress" + ); + } } } }