diff --git a/src/codec/h264.rs b/src/codec/h264.rs index cb9f2f2..8b50213 100644 --- a/src/codec/h264.rs +++ b/src/codec/h264.rs @@ -90,6 +90,9 @@ impl NalParser { let mut did_find_boundary = false; for (idx, byte) in data.iter().enumerate() { + // If the current FU-A has a boundary that splits at end, ignore the last or + // last two zeros because this boundary will be handled when the start of + // next packet is being read, and these zeros will be removed on walk-back. if byte == &0x00 && idx + 2 < data.len() && &data[idx..idx + 3] == &[0x00; 3] { debug!("Found boundary with index range: {} - {}.", idx, idx + 2); // we found a boundary, let NalParser know that it should now keep adding