1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/cbs_av1: implement a CodedBitstreamType.flush() callback

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2020-09-24 18:06:35 -03:00
parent 515b6419ca
commit dfd184eed5

View File

@ -1194,6 +1194,19 @@ static int cbs_av1_assemble_fragment(CodedBitstreamContext *ctx,
return 0;
}
static void cbs_av1_flush(CodedBitstreamContext *ctx)
{
CodedBitstreamAV1Context *priv = ctx->priv_data;
av_buffer_unref(&priv->frame_header_ref);
priv->sequence_header = NULL;
priv->frame_header = NULL;
memset(priv->ref, 0, sizeof(priv->ref));
priv->operating_point_idc = 0;
priv->seen_frame_header = 0;
}
static void cbs_av1_close(CodedBitstreamContext *ctx)
{
CodedBitstreamAV1Context *priv = ctx->priv_data;
@ -1250,5 +1263,6 @@ const CodedBitstreamType ff_cbs_type_av1 = {
.write_unit = &cbs_av1_write_obu,
.assemble_fragment = &cbs_av1_assemble_fragment,
.flush = &cbs_av1_flush,
.close = &cbs_av1_close,
};