Prevent fragmentation when adding timing info

This commit is contained in:
Patrick Nicolas committed 2026-10-02 18:53:16 +02:00
1 parent 7e0bf5efc1
commit e8c92a7202
1 file changed
+6 -1
+6 -1
View File
@@ -324,7 +324,12 @@ void video_encoder::SendData(std::span<uint8_t> data, bool end_of_frame, bool co
if (next == end)
{
if (end_of_frame)
shard.timing_info = timing_info;
{
if (serialized_size(timing_info) + std::distance(begin, next) <= max_payload_size)
shard.timing_info = timing_info;
else
--next;
}
}
shard.payload = {begin, next};
try