Skip to content

Commit

Permalink
Limit network batch size also by packet count
Browse files Browse the repository at this point in the history
Previously it was limited only by size, and exceeding 64 packets in a
single batch is asking for problems.
  • Loading branch information
ns6089 committed Jul 12, 2024
1 parent b70a8d1 commit 5ccfe9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,10 @@ namespace stream {
// appear in "Other I/O" and begin waiting for interrupts.
// This gives inconsistent performance so we'd rather avoid it.
size_t send_batch_size = 64 * 1024 / blocksize;
// Also don't exceed 64 packets, which can happen when Moonlight requests
// unusually small packet size.
// Generic Segmentation Offload on Linux can't do more than 64.
send_batch_size = std::min<size_t>(64, send_batch_size);

// Don't ignore the last ratecontrol group of the previous frame
auto ratecontrol_frame_start = std::max(ratecontrol_next_frame_start, std::chrono::steady_clock::now());
Expand Down

0 comments on commit 5ccfe9a

Please sign in to comment.