From c98ef6e8a9646053694800e7e3448f8c9ec52ee4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 4 Apr 2020 12:47:44 -0700 Subject: [PATCH] Display a friendly error when trying to stream over 4K with H.264 --- app/streaming/session.cpp | 12 ++++++++++++ moonlight-common-c/moonlight-common-c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 31cce3a7..623b5d2f 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -628,6 +628,18 @@ bool Session::validateLaunch(SDL_Window* testWindow) emitLaunchWarning("An attached gamepad has no mapping and won't be usable. Visit the Moonlight help to resolve this."); } + // NVENC will fail to initialize when using dimensions over 4096 and H.264. + if (m_StreamConfig.width > 4096 || m_StreamConfig.height > 4096) { + if (m_Computer->maxLumaPixelsHEVC == 0) { + emit displayLaunchError("Your host PC's GPU doesn't support streaming video resolutions over 4K."); + return false; + } + else if (!m_StreamConfig.supportsHevc) { + emit displayLaunchError("Video resolutions over 4K are only supported by the HEVC codec."); + return false; + } + } + if (m_Preferences->videoDecoderSelection == StreamingPreferences::VDS_FORCE_HARDWARE && !m_StreamConfig.enableHdr && // HEVC Main10 was already checked for hardware decode support above !isHardwareDecodeAvailable(testWindow, diff --git a/moonlight-common-c/moonlight-common-c b/moonlight-common-c/moonlight-common-c index c2471157..0cda408d 160000 --- a/moonlight-common-c/moonlight-common-c +++ b/moonlight-common-c/moonlight-common-c @@ -1 +1 @@ -Subproject commit c2471157c0e1ba841f8419e7009c8835fb2e6d45 +Subproject commit 0cda408d3c152aa3dc14bd49bac633bff2c6e493