mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-21 14:26:59 +00:00
avcodec/cuvid: Allow reinitialization of decoder
In practice, this works fine.
This commit is contained in:
parent
cc71fa319f
commit
ee7d6738ca
@ -141,9 +141,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (ctx->cudecoder) {
|
if (ctx->cudecoder) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "re-initializing decoder is not supported\n");
|
av_log(avctx, AV_LOG_TRACE, "Re-initializing decoder\n");
|
||||||
ctx->internal_error = AVERROR(EINVAL);
|
ctx->internal_error = CHECK_CU(cuvidDestroyDecoder(ctx->cudecoder));
|
||||||
return 0;
|
if (ctx->internal_error < 0)
|
||||||
|
return 0;
|
||||||
|
ctx->cudecoder = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwframe_ctx->pool && (
|
if (hwframe_ctx->pool && (
|
||||||
|
Loading…
Reference in New Issue
Block a user