Merge pull request #459 from BtbN/nvenc_delay_perf

Delay NVENC Frame output to enhance performance
master
Richard Stanway 2016-03-28 17:27:30 -04:00
commit e4e06afc0a
1 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ void NVENCEncoder::init()
encoderPreset = NV_ENC_PRESET_HQ_GUID;
is2PassRC = false;
}
if (height > 720 || (height == 720 && fps > 30))
if (height > 720 || (height == 720 && fps > 60))
{
encoderPreset = NV_ENC_PRESET_LOW_LATENCY_HQ_GUID;
is2PassRC = false;
@ -590,7 +590,7 @@ bool NVENCEncoder::Encode(LPVOID picIn, List<DataPacket> &packets, List<PacketTy
}
}
if (!outputSurfaceQueueReady.empty())
if (!outputSurfaceQueueReady.empty() && (!picIn || outputSurfaceQueue.size() + outputSurfaceQueueReady.size() >= maxSurfaceCount - 1))
{
NVENCEncoderOutputSurface *qSurf = outputSurfaceQueueReady.front();
outputSurfaceQueueReady.pop();