h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
authorJames Almer <jamrial@gmail.com>
Fri, 27 Jul 2018 16:21:16 +0000 (13:21 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 17 Aug 2018 17:06:21 +0000 (14:06 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/h264_mp4toannexb_bsf.c

index c65aaeb..c45ecd8 100644 (file)
@@ -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,
 };