-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Currently in h264 and h265 retina will bail if the Fragmentation Unit length is 0:
Lines 391 to 395 in d1e5055
| // FU-A. https://tools.ietf.org/html/rfc6184#section-5.8 | |
| if data.len() < 3 { | |
| // NAL + FU-A headers take 2 byte; need at least 3 bytes to make progress. | |
| return Err(format!("FU-A len {} too short", data.len())); | |
| } |
Lines 311 to 314 in d1e5055
| // Fragmentation Unit. https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.3 | |
| if data.len() < 2 { | |
| return Err(format!("FU len {} too short", data.len())); | |
| } |
These checks ensure that the packet is at least the required headers + one byte. Having a non-zero length isn't actually enforced by the spec and some cameras actually send empty Frag NALs.
Note that gortsplib implementations, the
pkt.Payloadsize includes the NAL header
By accepting empty Fragmentation packets, the stream can be played without interruption.
For h264, it would mean changing to:
if data.len() < 2 {
// NAL + FU-A headers take 2 byte
return Err(format!("FU-A len {} too short", data.len()));
} and a 1 byte check for h265
darkSuperman
Metadata
Metadata
Assignees
Labels
No labels