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