diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-01-05 15:16:23 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-02-07 00:31:23 +0100 |
commit | de40342c0442ce5bd423ba373e465625bc504f3e (patch) | |
tree | 7cb9543d815de31c2f2fdd648839aadbb9386d73 /libavcodec/cuviddec.c | |
parent | 70611d7f3b8521a4b91d81a023d80287d4cad07b (diff) |
lavc/cuviddec: do not reallocate the fifo unnecessarily
Diffstat (limited to 'libavcodec/cuviddec.c')
-rw-r--r-- | libavcodec/cuviddec.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index f03bbd8c4b..b1a3d674ab 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -1030,13 +1030,7 @@ static void cuvid_flush(AVCodecContext *avctx) if (ret < 0) goto error; - av_fifo_freep(&ctx->frame_queue); - - ctx->frame_queue = av_fifo_alloc(ctx->nb_surfaces * sizeof(CuvidParsedFrame)); - if (!ctx->frame_queue) { - av_log(avctx, AV_LOG_ERROR, "Failed to recreate frame queue on flush\n"); - return; - } + av_fifo_reset(ctx->frame_queue); if (ctx->cudecoder) { ctx->cvdl->cuvidDestroyDecoder(ctx->cudecoder); |