summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mp4toannexb_bsf.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-07-26 20:34:52 -0300
committerJames Almer <jamrial@gmail.com>2018-08-16 23:43:10 -0300
commit390f156451bc860169deca68eee4e21bf746a9ab (patch)
treed1fd221bb5c0528ed5f0af2e3535f834e2ba0aef /libavcodec/h264_mp4toannexb_bsf.c
parentb33f5299a59f5f155a4df5cb630b1de2acdb25b2 (diff)
downloadffmpeg-390f156451bc860169deca68eee4e21bf746a9ab.tar.gz
avcodec/h264_mp4toannexb_bsf: implement a AVBSFContext.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/h264_mp4toannexb_bsf.c')
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c10
1 files changed, 10 insertions, 0 deletions
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,
};