avcodec/vp9_raw_reorder: reset state when flushing

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2019-05-06 00:22:32 -03:00
parent d88193c219
commit fec4212d8e
1 changed files with 11 additions and 0 deletions

View File

@ -385,6 +385,16 @@ fail:
return err; return err;
} }
static void vp9_raw_reorder_flush(AVBSFContext *bsf)
{
VP9RawReorderContext *ctx = bsf->priv_data;
for (int s = 0; s < FRAME_SLOTS; s++)
vp9_raw_reorder_clear_slot(ctx, s);
ctx->next_frame = NULL;
ctx->sequence = 0;
}
static void vp9_raw_reorder_close(AVBSFContext *bsf) static void vp9_raw_reorder_close(AVBSFContext *bsf)
{ {
VP9RawReorderContext *ctx = bsf->priv_data; VP9RawReorderContext *ctx = bsf->priv_data;
@ -402,6 +412,7 @@ const AVBitStreamFilter ff_vp9_raw_reorder_bsf = {
.name = "vp9_raw_reorder", .name = "vp9_raw_reorder",
.priv_data_size = sizeof(VP9RawReorderContext), .priv_data_size = sizeof(VP9RawReorderContext),
.close = &vp9_raw_reorder_close, .close = &vp9_raw_reorder_close,
.flush = &vp9_raw_reorder_flush,
.filter = &vp9_raw_reorder_filter, .filter = &vp9_raw_reorder_filter,
.codec_ids = vp9_raw_reorder_codec_ids, .codec_ids = vp9_raw_reorder_codec_ids,
}; };