[FFmpeg-cvslog] avcodec/vp9_raw_reorder: reset state when flushing

James Almer git at videolan.org
Mon May 6 06:25:31 EEST 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon May  6 00:22:32 2019 -0300| [fec4212d8e0906234790678cfc08e342e74e646c] | committer: James Almer

avcodec/vp9_raw_reorder: reset state when flushing

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fec4212d8e0906234790678cfc08e342e74e646c
---

 libavcodec/vp9_raw_reorder_bsf.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/vp9_raw_reorder_bsf.c b/libavcodec/vp9_raw_reorder_bsf.c
index 01f3dad898..f19b4c7198 100644
--- a/libavcodec/vp9_raw_reorder_bsf.c
+++ b/libavcodec/vp9_raw_reorder_bsf.c
@@ -385,6 +385,16 @@ fail:
     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)
 {
     VP9RawReorderContext *ctx = bsf->priv_data;
@@ -402,6 +412,7 @@ const AVBitStreamFilter ff_vp9_raw_reorder_bsf = {
     .name           = "vp9_raw_reorder",
     .priv_data_size = sizeof(VP9RawReorderContext),
     .close          = &vp9_raw_reorder_close,
+    .flush          = &vp9_raw_reorder_flush,
     .filter         = &vp9_raw_reorder_filter,
     .codec_ids      = vp9_raw_reorder_codec_ids,
 };



More information about the ffmpeg-cvslog mailing list