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:
@@ -325,16 +325,19 @@ async fn run_file_mode(
|
|||||||
result = recv_transport.recv_media() => {
|
result = recv_transport.recv_media() => {
|
||||||
match result {
|
match result {
|
||||||
Ok(Some(pkt)) => {
|
Ok(Some(pkt)) => {
|
||||||
|
let is_repair = pkt.header.is_repair;
|
||||||
decoder.ingest(pkt);
|
decoder.ingest(pkt);
|
||||||
while let Some(n) = decoder.decode_next(&mut pcm_buf) {
|
if !is_repair {
|
||||||
all_pcm.extend_from_slice(&pcm_buf[..n]);
|
if let Some(n) = decoder.decode_next(&mut pcm_buf) {
|
||||||
frames_received += 1;
|
all_pcm.extend_from_slice(&pcm_buf[..n]);
|
||||||
if frames_received % 250 == 0 {
|
frames_received += 1;
|
||||||
info!(
|
if frames_received % 250 == 0 {
|
||||||
frames = frames_received,
|
info!(
|
||||||
samples = all_pcm.len(),
|
frames = frames_received,
|
||||||
"recv progress"
|
samples = all_pcm.len(),
|
||||||
);
|
"recv progress"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user