diff mbox series

[FFmpeg-devel,v2,08/31] lavc/cuviddec: do not reallocate the fifo unnecessarily

Message ID AM7PR03MB6660557C0F71A86846708BBC8F5E9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Headers show
Series New FIFO API | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 24, 2022, 2:45 p.m. UTC
From: Anton Khirnov <anton@khirnov.net>

---
 libavcodec/cuviddec.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

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);