summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-07-26 22:26:01 -0300
committerJames Almer <jamrial@gmail.com>2018-08-16 23:43:12 -0300
commite5b1f2b02749c7fb02a26b65adb72fd9fdf630be (patch)
treeed3acf8b1bd86565a50d1cdbf397ddda25ae3d6c /libavcodec
parente9980c451e294dbc8c81ed8dd4a8e5792397fbbe (diff)
avcodec/mpeg4_unpack_bframes_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4_unpack_bframes_bsf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mpeg4_unpack_bframes_bsf.c b/libavcodec/mpeg4_unpack_bframes_bsf.c
index c2b779a9d5..e9c535f390 100644
--- a/libavcodec/mpeg4_unpack_bframes_bsf.c
+++ b/libavcodec/mpeg4_unpack_bframes_bsf.c
@@ -166,6 +166,12 @@ static int mpeg4_unpack_bframes_init(AVBSFContext *ctx)
return 0;
}
+static void mpeg4_unpack_bframes_flush(AVBSFContext *bsfc)
+{
+ UnpackBFramesBSFContext *ctx = bsfc->priv_data;
+ av_packet_unref(ctx->b_frame);
+}
+
static void mpeg4_unpack_bframes_close(AVBSFContext *bsfc)
{
UnpackBFramesBSFContext *ctx = bsfc->priv_data;
@@ -181,6 +187,7 @@ const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf = {
.priv_data_size = sizeof(UnpackBFramesBSFContext),
.init = mpeg4_unpack_bframes_init,
.filter = mpeg4_unpack_bframes_filter,
+ .flush = mpeg4_unpack_bframes_flush,
.close = mpeg4_unpack_bframes_close,
.codec_ids = codec_ids,
};