On 15.07.2020 16:34, wangbin wrote:
From: wang-bin <wbse...@gmail.com>
---
libavcodec/nvenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index ac35cb9f48..cec59f02f3 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -140,7 +140,7 @@ static int nvenc_print_error(AVCodecContext *avctx,
NVENCSTATUS err,
NvencContext *ctx = avctx->priv_data;
NV_ENCODE_API_FUNCTION_LIST *p_nvenc =
&ctx->nvenc_dload_funcs.nvenc_funcs;
- if (p_nvenc && ctx->nvencoder)
+ if (p_nvenc && ctx->nvencoder && p_nvenc->nvEncGetLastErrorString)
details = p_nvenc->nvEncGetLastErrorString(ctx->nvencoder);
#endif
@@ -1353,7 +1353,7 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
}
#ifdef NVENC_HAVE_CUSTREAM_PTR
- if (ctx->cu_context) {
+ if (ctx->cu_context && p_nvenc->nvEncSetIOCudaStreams) {
nv_status = p_nvenc->nvEncSetIOCudaStreams(ctx->nvencoder, &ctx->cu_stream,
&ctx->cu_stream);
if (nv_status != NV_ENC_SUCCESS) {
nvenc_pop_context(avctx);
This will need a lot more handling of error cases to present a
meaningful error.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".