diff mbox series

[FFmpeg-devel,36/36] avcodec/vp9_superframe_bsf: Merge close and flush

Message ID 20200530160541.29517-36-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 30, 2020, 4:05 p.m. UTC
They are essentially identical now.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/vp9_superframe_bsf.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index 6d6b2c57de..278f5a47a6 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -31,7 +31,7 @@  typedef struct VP9BSFContext {
     int n_cache;
 } VP9BSFContext;
 
-static void vp9_superframe_flush(AVBSFContext *ctx)
+static void vp9_superframe_close_flush(AVBSFContext *ctx)
 {
     VP9BSFContext *s = ctx->priv_data;
 
@@ -184,7 +184,7 @@  static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
     // build superframe
     res = merge_superframe(s->cache, s->n_cache, pkt);
 
-    vp9_superframe_flush(ctx);
+    vp9_superframe_close_flush(ctx);
 
 done:
     if (res < 0)
@@ -192,16 +192,6 @@  done:
     return res;
 }
 
-static void vp9_superframe_close(AVBSFContext *ctx)
-{
-    VP9BSFContext *s = ctx->priv_data;
-    int n;
-
-    // free cached data
-    for (n = 0; n < MAX_CACHE; n++)
-        av_buffer_unref(&s->cache[n]);
-}
-
 static const enum AVCodecID codec_ids[] = {
     AV_CODEC_ID_VP9, AV_CODEC_ID_NONE,
 };
@@ -210,7 +200,7 @@  const AVBitStreamFilter ff_vp9_superframe_bsf = {
     .name           = "vp9_superframe",
     .priv_data_size = sizeof(VP9BSFContext),
     .filter         = vp9_superframe_filter,
-    .flush          = vp9_superframe_flush,
-    .close          = vp9_superframe_close,
+    .flush          = vp9_superframe_close_flush,
+    .close          = vp9_superframe_close_flush,
     .codec_ids      = codec_ids,
 };