Skip to content

Commit

Permalink
Add more logs for reed solomon encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
hgaiser committed Dec 19, 2024
1 parent 1b99194 commit f7219bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/session/stream/video/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,16 @@ impl Encoder {
fn get_fec_encoder(&mut self, nr_data_shards: usize, nr_parity_shards: usize) -> Result<&mut ReedSolomon<galois_8::Field>, ()> {
Ok(match self.fec_encoders.entry((nr_data_shards, nr_parity_shards)) {
Entry::Occupied(e) => {
tracing::trace!("Found a FEC encoder for this combination of shards.");
e.into_mut()
},
Entry::Vacant(e) => {
e.insert(ReedSolomon::<galois_8::Field>::new(nr_data_shards, nr_parity_shards)
.map_err(|e| tracing::error!("Couldn't create error correction encoder: {e}"))?)
tracing::trace!("No FEC encoder for this combination of shards, creating a new one.");
let encoder = e.insert(ReedSolomon::<galois_8::Field>::new(nr_data_shards, nr_parity_shards)
.map_err(|e| tracing::error!("Couldn't create error correction encoder: {e}"))?);
tracing::trace!("Finished preparing FEC encoder.");

encoder
}
})
}
Expand Down

0 comments on commit f7219bf

Please sign in to comment.