summaryrefslogtreecommitdiff
path: root/libavcodec/nvdec.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-11-12 18:09:31 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-13 20:33:10 +0100
commit538de4354dcd6c57154c5a5dec0744dcaa06b874 (patch)
tree9e72995b07b7ccc8f75a8077586e6409f32d2fc6 /libavcodec/nvdec.c
parentf3f73f0893e2bddd80897148d21cdf3e8e4d8492 (diff)
avcodec/nvdec: warn about thread count if applicable
Diffstat (limited to 'libavcodec/nvdec.c')
-rw-r--r--libavcodec/nvdec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c
index 7d768b2327..5d65f1d3dd 100644
--- a/libavcodec/nvdec.c
+++ b/libavcodec/nvdec.c
@@ -292,8 +292,15 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
params.ulNumOutputSurfaces = 1;
ret = nvdec_decoder_create(&ctx->decoder_ref, frames_ctx->device_ref, &params, avctx);
- if (ret < 0)
+ if (ret < 0) {
+ if (params.ulNumDecodeSurfaces > 32) {
+ av_log(avctx, AV_LOG_WARNING, "Using more than 32 (%d) decode surfaces might cause nvdec to fail.\n",
+ (int)params.ulNumDecodeSurfaces);
+ av_log(avctx, AV_LOG_WARNING, "Try lowering the amount of threads. Using %d right now.\n",
+ avctx->thread_count);
+ }
return ret;
+ }
pool = av_mallocz(sizeof(*pool));
if (!pool) {