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) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 18:05:10 +04:00
parent d5390db7af
commit a04b8271cc

View File

@@ -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"
);
}
}
}
}