From fcc4edb556c3015b94858f7fbb8565c479b2da43 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 8 May 2016 11:48:18 -0400 Subject: [PATCH] Use larger video packets to offset the higher packet reception overhead of NaCl --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index bb3934c..94b3051 100644 --- a/main.cpp +++ b/main.cpp @@ -181,10 +181,15 @@ void MoonlightInstance::HandleStartStream(int32_t callbackId, pp::VarArray args) m_StreamConfig.height = stoi(height); m_StreamConfig.fps = stoi(fps); m_StreamConfig.bitrate = stoi(bitrate); // kilobits per second - m_StreamConfig.packetSize = 1024; m_StreamConfig.streamingRemotely = 0; m_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO; + // The overhead of receiving a packet is much higher in NaCl because we must + // pass through various layers of abstraction on each recv() call. We're using a + // higher than normal default video packet size here to reduce CPU cycles wasted + // receiving packets. The possible cost is greater network losses. + m_StreamConfig.packetSize = 1392; + m_ServerMajorVersion = stoi(serverMajorVersion); // Initialize the rendering surface before starting the connection