-
Notifications
You must be signed in to change notification settings - Fork 59
Description
I have some streams over UDP multicast that basically run 24/7, and I have been trying to capture them with this package. However, since I join after the stream has already started, it seems like it's basically random where I join the stream. The Sync byte won't always be the first byte the reader encounters.
This breaks packet size detection, and if I set the size with an option, I immediately get "packet must start with sync byte."
I've implemented a hack to get around this by wrapping the io.Reader in a bufio.Reader, peeking the first 193 bytes and discarding up to the first sync byte before I hand the reader off to the Demuxer, but that feels like a lot of MPEG-TS to leak outside the abstraction. Even the astits-probe program, which supports UDP multicast sources, suffers from this: you must start the probe before the stream begins transmitting to reliably sync up.