mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-08 08:46:24 +00:00
Force remote streaming mode if connecting through a VPN
This commit is contained in:
@@ -356,8 +356,6 @@ bool Session::initialize()
|
||||
m_StreamConfig.fps = m_Preferences->fps;
|
||||
m_StreamConfig.bitrate = m_Preferences->bitrateKbps;
|
||||
m_StreamConfig.hevcBitratePercentageMultiplier = 75;
|
||||
m_StreamConfig.streamingRemotely = STREAM_CFG_AUTO;
|
||||
m_StreamConfig.packetSize = 1392;
|
||||
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Video bitrate: %d kbps",
|
||||
@@ -937,6 +935,19 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||
hostInfo.serverInfoGfeVersion = siGfeVersion.data();
|
||||
}
|
||||
|
||||
// isReachableOverVpn() does network I/O, so we only attempt to check
|
||||
// VPN reachability if we've already contacted the PC successfully
|
||||
if (m_Computer->isReachableOverVpn()) {
|
||||
// It looks like our route to this PC is over a VPN.
|
||||
// Treat it as remote even if the target address is in RFC 1918 address space.
|
||||
m_StreamConfig.streamingRemotely = STREAM_CFG_REMOTE;
|
||||
m_StreamConfig.packetSize = 1024;
|
||||
}
|
||||
else {
|
||||
m_StreamConfig.streamingRemotely = STREAM_CFG_AUTO;
|
||||
m_StreamConfig.packetSize = 1392;
|
||||
}
|
||||
|
||||
int err = LiStartConnection(&hostInfo, &m_StreamConfig, &k_ConnCallbacks,
|
||||
&m_VideoCallbacks,
|
||||
m_AudioDisabled ? nullptr : &m_AudioCallbacks,
|
||||
|
||||
Reference in New Issue
Block a user