[FFmpeg-cvslog] avcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback

James Almer git at videolan.org
Fri Aug 17 06:07:12 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Jul 26 20:34:52 2018 -0300| [390f156451bc860169deca68eee4e21bf746a9ab] | committer: James Almer

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

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=390f156451bc860169deca68eee4e21bf746a9ab
---

 libavcodec/h264_mp4toannexb_bsf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index 794c82e650..fb3f24ea40 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -280,6 +280,15 @@ fail:
     return ret;
 }
 
+static void h264_mp4toannexb_flush(AVBSFContext *ctx)
+{
+    H264BSFContext *s = ctx->priv_data;
+
+    s->idr_sps_seen = 0;
+    s->idr_pps_seen = 0;
+    s->new_idr      = s->extradata_parsed;
+}
+
 static const enum AVCodecID codec_ids[] = {
     AV_CODEC_ID_H264, AV_CODEC_ID_NONE,
 };
@@ -289,5 +298,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,
 };



More information about the ffmpeg-cvslog mailing list