summaryrefslogtreecommitdiff
path: root/libavcodec/cuviddec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-01-05 15:16:23 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-02-07 00:31:23 +0100
commitde40342c0442ce5bd423ba373e465625bc504f3e (patch)
tree7cb9543d815de31c2f2fdd648839aadbb9386d73 /libavcodec/cuviddec.c
parent70611d7f3b8521a4b91d81a023d80287d4cad07b (diff)
lavc/cuviddec: do not reallocate the fifo unnecessarily
Diffstat (limited to 'libavcodec/cuviddec.c')
-rw-r--r--libavcodec/cuviddec.c8
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);