mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-26 03:46:49 -08:00
Prevent fragmentation when adding timing info
This commit is contained in:
1 parent
7e0bf5efc1
commit
e8c92a7202
1 file changed
+6
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user