Drop the redundant complete-block short circuit from FEC recovery
A block with every data shard present passes through the code as a no-op and yields no recovered records, so the early return in both recovery functions did nothing the code did not already do. Mutation showed both survive removal. The audio payload-length rule is now pinned by its message, since the codec's own shard-size error would otherwise mask its removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1da2a64fbc
commit
4b85a173e8
2 changed files with 2 additions and 7 deletions
|
|
@ -450,9 +450,6 @@ pub fn recover_video_block(
|
|||
}
|
||||
|
||||
let missing: Vec<usize> = (0..k).filter(|&slot| shards[slot].is_none()).collect();
|
||||
if missing.is_empty() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
let recovered = recover_data_shards(k, shards)?;
|
||||
Ok(missing
|
||||
.into_iter()
|
||||
|
|
@ -617,9 +614,6 @@ pub fn recover_audio_block(
|
|||
}
|
||||
|
||||
let missing: Vec<usize> = (0..k).filter(|&slot| shards[slot].is_none()).collect();
|
||||
if missing.is_empty() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
let recovered = recover_data_shards(k, shards)?;
|
||||
Ok(missing
|
||||
.into_iter()
|
||||
|
|
|
|||
|
|
@ -592,7 +592,8 @@ fn an_audio_block_is_four_contiguous_equal_length_packets() {
|
|||
assert!(protect_audio_block(&packets, &STANDARD).is_err(), "a gap in presentation time");
|
||||
let mut packets = audio_block(1, 20);
|
||||
packets[3].payload.push(0);
|
||||
assert!(protect_audio_block(&packets, &STANDARD).is_err(), "unequal payload lengths");
|
||||
let error = protect_audio_block(&packets, &STANDARD).unwrap_err();
|
||||
assert!(error.to_string().contains("payload length"), "unequal payload lengths: {error}");
|
||||
let mut packets = audio_block(1, 20);
|
||||
packets[0].codec = "pcm".to_string();
|
||||
assert!(protect_audio_block(&packets, &STANDARD).is_err(), "mixed codecs");
|
||||
|
|
|
|||
Loading…
Reference in a new issue