[FFmpeg-devel] [PATCH 3/8] avcodec/vp9_superframe_split_bsf: implement a AVBSFContext.flush() callback

James Almer jamrial at gmail.com
Fri Jul 27 17:57:44 EEST 2018


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/vp9_superframe_split_bsf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_superframe_split_bsf.c
index 9c4aa33dc1..77bfcb4cdf 100644
--- a/libavcodec/vp9_superframe_split_bsf.c
+++ b/libavcodec/vp9_superframe_split_bsf.c
@@ -132,6 +132,14 @@ fail:
     return ret;
 }
 
+static void vp9_superframe_split_flush(AVBSFContext *ctx)
+{
+    VP9SFSplitContext *s = ctx->priv_data;
+
+    av_packet_unref(&s->buffer_pkt);
+    memset(s, 0, sizeof(*s));
+}
+
 static void vp9_superframe_split_uninit(AVBSFContext *ctx)
 {
     VP9SFSplitContext *s = ctx->priv_data;
@@ -143,5 +151,6 @@ const AVBitStreamFilter ff_vp9_superframe_split_bsf = {
     .priv_data_size = sizeof(VP9SFSplitContext),
     .close          = vp9_superframe_split_uninit,
     .filter         = vp9_superframe_split_filter,
+    .flush          = vp9_superframe_split_flush,
     .codec_ids      = (const enum AVCodecID []){ AV_CODEC_ID_VP9, AV_CODEC_ID_NONE },
 };
-- 
2.18.0



More information about the ffmpeg-devel mailing list