Round down odd height values to avoid NVENC initialization failure

This commit is contained in:
Cameron Gutman 2020-04-04 11:51:55 -07:00
parent 86751d9162
commit 4f9d45fbb5

View File

@ -208,6 +208,14 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
err = -1;
goto Cleanup;
}
// Height must not be odd or NVENC will fail to initialize
if (StreamConfig.height & 0x1) {
Limelog("Encoder height must not be odd. Rounding %d to %d",
StreamConfig.height,
StreamConfig.height & ~0x1);
StreamConfig.height = StreamConfig.height & ~0x1;
}
// Extract the appversion from the supplied string
if (extractVersionQuadFromString(serverInfo->serverInfoAppVersion,