[libav-devel] [PATCH 2/7] avcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback

James Almer jamrial at gmail.com
Fri Jul 27 19:59:52 CEST 2018


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

diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index c65aaeb98..c45ecd8ce 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -232,6 +232,13 @@ fail:
     return ret;
 }
 
+static void h264_mp4toannexb_flush(AVBSFContext *ctx)
+{
+    H264BSFContext *s = ctx->priv_data;
+
+    s->first_idr = s->extradata_parsed;
+}
+
 static const enum AVCodecID codec_ids[] = {
     AV_CODEC_ID_H264, AV_CODEC_ID_NONE,
 };
@@ -241,5 +248,6 @@ const AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
     .priv_data_size = sizeof(H264BSFContext),
     .init           = h264_mp4toannexb_init,
     .filter         = h264_mp4toannexb_filter,
+    .flush          = h264_mp4toannexb_flush,
     .codec_ids      = codec_ids,
 };
-- 
2.18.0



More information about the libav-devel mailing list