From 104fb4be89e26ac91ed0f6e8bb1c325b83989918 Mon Sep 17 00:00:00 2001
From: Ruta Gadkari <rgadkari@nvidia.com>
Date: Mon, 26 Dec 2016 13:19:16 +0530
Subject: [PATCH 1/1] NVENC: Update check for Lookahead

---
 libavcodec/nvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 476a53e..f64fd8a 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -695,7 +695,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_VERBOSE, "Temporal AQ enabled.\n");
     }
 
-    if (ctx->rc_lookahead) {
+    if (ctx->rc_lookahead > 0) {
         int lkd_bound = FFMIN(ctx->nb_surfaces, ctx->async_depth) -
                         ctx->encode_config.frameIntervalP - 4;
 
-- 
1.9.1

