Browse Source

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

Signed-off-by: James Almer <jamrial@gmail.com>
tags/n4.1
James Almer 7 years ago
parent
commit
e5b1f2b027
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/mpeg4_unpack_bframes_bsf.c

+ 7
- 0
libavcodec/mpeg4_unpack_bframes_bsf.c View File

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

Loading…
Cancel
Save