ffmpeg | branch: master | Anton Khirnov <an...@khirnov.net> | Wed Jan  5 
15:16:23 2022 +0100| [de40342c0442ce5bd423ba373e465625bc504f3e] | committer: 
Andreas Rheinhardt

lavc/cuviddec: do not reallocate the fifo unnecessarily

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de40342c0442ce5bd423ba373e465625bc504f3e
---

 libavcodec/cuviddec.c | 8 +-------
 1 file changed, 1 insertion(+), 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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to