summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_av1.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-09-24 18:06:35 -0300
committerJames Almer <jamrial@gmail.com>2020-09-29 21:38:27 -0300
commitdfd184eed549d7cd8e9095f18a7da8e5b050db2c (patch)
treec53241b88be2d85276a689e2e1e3cb201cfbcf84 /libavcodec/cbs_av1.c
parent515b6419ca51f036a2d6dd42841a4be07147f865 (diff)
downloadffmpeg-dfd184eed549d7cd8e9095f18a7da8e5b050db2c.tar.gz
avcodec/cbs_av1: implement a CodedBitstreamType.flush() callback
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cbs_av1.c')
-rw-r--r--libavcodec/cbs_av1.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index dcf6c140ae..65cf45fcfa 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -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,
};