diff options
author | James Almer <jamrial@gmail.com> | 2018-07-26 22:24:47 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-08-16 23:43:11 -0300 |
commit | e9980c451e294dbc8c81ed8dd4a8e5792397fbbe (patch) | |
tree | 88515f25dd2d25054245d070aae5e2fd54a5c687 | |
parent | 63e0846c66607a1a4cce027d9f55e353c4b56948 (diff) | |
download | ffmpeg-e9980c451e294dbc8c81ed8dd4a8e5792397fbbe.tar.gz |
avcodec/vp9_superframe_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/vp9_superframe_bsf.c | 12 |
1 files changed, 12 insertions, 0 deletions
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, }; |