avcodec/cbs: add a flush callback to CodedBitstreamType

Used to reset the codec's private internal state.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2020-09-24 17:57:42 -03:00
parent 23d0754165
commit 515b6419ca
3 changed files with 14 additions and 0 deletions

View File

@@ -112,6 +112,12 @@ int ff_cbs_init(CodedBitstreamContext **ctx_ptr,
return 0;
}
void ff_cbs_flush(CodedBitstreamContext *ctx)
{
if (ctx->codec && ctx->codec->flush)
ctx->codec->flush(ctx);
}
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
{
CodedBitstreamContext *ctx = *ctx_ptr;