[FFmpeg-cvslog] avcodec/nvenc: add logging for more error cases

Timo Rothenpieler git at videolan.org
Fri Jan 20 11:44:07 EET 2017


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Wed Jan 18 23:22:28 2017 +0100| [6b0a3ee6f809c577ee5e3d7c38af03d08d51a13f] | committer: Timo Rothenpieler

avcodec/nvenc: add logging for more error cases

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b0a3ee6f809c577ee5e3d7c38af03d08d51a13f
---

 libavcodec/nvenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 27d1a2b..7005465 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -325,12 +325,16 @@ static av_cold int nvenc_check_device(AVCodecContext *avctx, int idx)
     }
 
     cu_res = dl_fn->cuda_dl->cuDeviceGetName(name, sizeof(name), cu_device);
-    if (cu_res != CUDA_SUCCESS)
+    if (cu_res != CUDA_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "cuDeviceGetName failed on device %d\n", idx);
         return -1;
+    }
 
     cu_res = dl_fn->cuda_dl->cuDeviceComputeCapability(&major, &minor, cu_device);
-    if (cu_res != CUDA_SUCCESS)
+    if (cu_res != CUDA_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "cuDeviceComputeCapability failed on device %d\n", idx);
         return -1;
+    }
 
     av_log(avctx, loglevel, "[ GPU #%d - < %s > has Compute SM %d.%d ]\n", idx, name, major, minor);
     if (((major << 4) | minor) < NVENC_CAP) {



More information about the ffmpeg-cvslog mailing list