diff mbox series

[FFmpeg-devel,2/2] avcodec/vp9_raw_reorder_bsf: Merge close and flush

Message ID AS1PR01MB9564BE1962215063AD590B1B8FE19@AS1PR01MB9564.eurprd01.prod.exchangelabs.com
State Accepted
Commit 24fd3ff5a2e93fd9761c8a050f98e20d74b6dc6c
Headers show
Series [FFmpeg-devel,1/2] avcodec/vp9_raw_reorder_bsf: Fix leak of cached packet | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 31, 2022, 8:14 p.m. UTC
Also mark the function as av_cold while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vp9_raw_reorder_bsf.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vp9_raw_reorder_bsf.c b/libavcodec/vp9_raw_reorder_bsf.c
index 368dcb26c2..d36093316c 100644
--- a/libavcodec/vp9_raw_reorder_bsf.c
+++ b/libavcodec/vp9_raw_reorder_bsf.c
@@ -390,7 +390,7 @@  fail:
     return err;
 }
 
-static void vp9_raw_reorder_flush(AVBSFContext *bsf)
+static av_cold void vp9_raw_reorder_flush_close(AVBSFContext *bsf)
 {
     VP9RawReorderContext *ctx = bsf->priv_data;
 
@@ -400,16 +400,6 @@  static void vp9_raw_reorder_flush(AVBSFContext *bsf)
     ctx->sequence = 0;
 }
 
-static void vp9_raw_reorder_close(AVBSFContext *bsf)
-{
-    VP9RawReorderContext *ctx = bsf->priv_data;
-    int s;
-
-    for (s = 0; s < FRAME_SLOTS; s++)
-        vp9_raw_reorder_clear_slot(ctx, s);
-    vp9_raw_reorder_frame_free(&ctx->next_frame);
-}
-
 static const enum AVCodecID vp9_raw_reorder_codec_ids[] = {
     AV_CODEC_ID_VP9, AV_CODEC_ID_NONE,
 };
@@ -418,7 +408,7 @@  const FFBitStreamFilter ff_vp9_raw_reorder_bsf = {
     .p.name         = "vp9_raw_reorder",
     .p.codec_ids    = vp9_raw_reorder_codec_ids,
     .priv_data_size = sizeof(VP9RawReorderContext),
-    .close          = &vp9_raw_reorder_close,
-    .flush          = &vp9_raw_reorder_flush,
     .filter         = &vp9_raw_reorder_filter,
+    .flush          = &vp9_raw_reorder_flush_close,
+    .close          = &vp9_raw_reorder_flush_close,
 };