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

Submitted by James Almer on July 27, 2018, 2:57 p.m.

Details

Message ID 20180727145749.9436-3-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer July 27, 2018, 2:57 p.m.
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/vp9_superframe_split_bsf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

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 },
 };