diff options
author | sr55 <[email protected]> | 2020-09-26 15:18:38 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2020-09-26 15:23:23 +0100 |
commit | 4e079a0d29d286afeb7c083757912a7caaf3574a (patch) | |
tree | 55fac8d48546b645731bc1265ea3a94053c6e89e /libhb | |
parent | 918177ac8fda9d0f59ec0cdb3b0e7c3cc06241a8 (diff) |
nvenc: Fix duplicate logging of nvenc message. Also moved it to log level 2.
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/nvenc_common.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libhb/nvenc_common.c b/libhb/nvenc_common.c index 69b12de60..b611e60e6 100644 --- a/libhb/nvenc_common.c +++ b/libhb/nvenc_common.c @@ -15,7 +15,7 @@ #include <ffnvcodec/dynlink_loader.h> #endif -int hb_check_nvenc_available(); +static int is_nvenc_available = -1; int hb_nvenc_h264_available() { @@ -35,13 +35,17 @@ int hb_nvenc_h265_available() #endif } - int hb_check_nvenc_available() { if (is_hardware_disabled()) { return 0; } + + if (is_nvenc_available != -1) + { + return is_nvenc_available; + } #if HB_PROJECT_FEATURE_NVENC uint32_t nvenc_ver; @@ -55,9 +59,11 @@ int hb_check_nvenc_available() NVENCSTATUS apiErr = nvenc_dl->NvEncodeAPIGetMaxSupportedVersion(&nvenc_ver); if (apiErr != NV_ENC_SUCCESS) { + is_nvenc_available = 0; return 0; } else { - hb_log("Nvenc version %d.%d\n", nvenc_ver >> 4, nvenc_ver & 0xf); + hb_deep_log(1, "NVENC version %d.%d\n", nvenc_ver >> 4, nvenc_ver & 0xf); + is_nvenc_available = 1; return 1; } |