[FFmpeg-cvslog] avcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback

James Almer git at videolan.org
Fri Aug 17 06:07:17 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Jul 26 22:24:47 2018 -0300| [e9980c451e294dbc8c81ed8dd4a8e5792397fbbe] | committer: James Almer

avcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/vp9_superframe_bsf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index 52569ab097..ea6750750b 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -189,6 +189,17 @@ static int vp9_superframe_init(AVBSFContext *ctx)
     return 0;
 }
 
+static void vp9_superframe_flush(AVBSFContext *ctx)
+{
+    VP9BSFContext *s = ctx->priv_data;
+    int n;
+
+    // unref cached data
+    for (n = 0; n < s->n_cache; n++)
+        av_packet_unref(s->cache[n]);
+    s->n_cache = 0;
+}
+
 static void vp9_superframe_close(AVBSFContext *ctx)
 {
     VP9BSFContext *s = ctx->priv_data;
@@ -208,6 +219,7 @@ const AVBitStreamFilter ff_vp9_superframe_bsf = {
     .priv_data_size = sizeof(VP9BSFContext),
     .filter         = vp9_superframe_filter,
     .init           = vp9_superframe_init,
+    .flush          = vp9_superframe_flush,
     .close          = vp9_superframe_close,
     .codec_ids      = codec_ids,
 };



More information about the ffmpeg-cvslog mailing list