On Wed Feb 12 00:47:29 2025 +0000, Elizabeth Figura wrote:
Eh, sorry, my question was based on a misreading—these aren't coming from our demuxer.
I'm not sure we can tell what native does exactly here but IMO, and
especially as we're doing this only if we have a parser, this should instead use the parser in a standalone way to split the data into individual packets with the correct boundaries. This could probably be done in push_data, then every parsed buffer would be queued instead of the input data itself. Why is that better?
i think by doing that, we don't need to break the buffer into an arbitrary size? e.g. 4kbytes as chosen by this MR.
but i guess then there would be the problem that do we know the parser would always break the buffer up reasonably? (e.g. one chunk per frame). what if the parser also spit out enormous buffers.
i feel the only "clean" solution would be running the decoder in a separate thread, which would allow decoding to happen asynchronously.