summaryrefslogtreecommitdiff
path: root/libavcodec/cuvid.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2016-10-22 14:31:41 -0700
committerPhilip Langdale <philipl@overt.org>2016-10-22 14:57:00 -0700
commitee7d6738ca694872f84ed62dd33342d187d76464 (patch)
treee168721e912f483012f52d5fdaed5ba193b41826 /libavcodec/cuvid.c
parentcc71fa319fd7edc54c02a1c552a72cebd0fc4287 (diff)
avcodec/cuvid: Allow reinitialization of decoder
In practice, this works fine.
Diffstat (limited to 'libavcodec/cuvid.c')
-rw-r--r--libavcodec/cuvid.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c
index 27a4c30b00..24ade94ab9 100644
--- a/libavcodec/cuvid.c
+++ b/libavcodec/cuvid.c
@@ -141,9 +141,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return 1;
if (ctx->cudecoder) {
- av_log(avctx, AV_LOG_ERROR, "re-initializing decoder is not supported\n");
- ctx->internal_error = AVERROR(EINVAL);
- return 0;
+ av_log(avctx, AV_LOG_TRACE, "Re-initializing decoder\n");
+ ctx->internal_error = CHECK_CU(cuvidDestroyDecoder(ctx->cudecoder));
+ if (ctx->internal_error < 0)
+ return 0;
+ ctx->cudecoder = NULL;
}
if (hwframe_ctx->pool && (