[FFmpeg-cvslog] avcodec/bsf_list: implement a AVBSFContext.flush callback

James Almer git at videolan.org
Sun Jan 6 20:13:57 EET 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Jan  6 00:31:47 2019 -0300| [674b59c07515409eb815c91bee90fe4151905a10] | committer: James Almer

avcodec/bsf_list: implement a AVBSFContext.flush callback

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

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

 libavcodec/bsf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 03841da682..5081307603 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -350,6 +350,15 @@ static int bsf_list_filter(AVBSFContext *bsf, AVPacket *out)
     return ret;
 }
 
+static void bsf_list_flush(AVBSFContext *bsf)
+{
+    BSFListContext *lst = bsf->priv_data;
+
+    for (int i = 0; i < lst->nb_bsfs; i++)
+        av_bsf_flush(lst->bsfs[i]);
+    lst->idx = lst->flushed_idx = 0;
+}
+
 static void bsf_list_close(AVBSFContext *bsf)
 {
     BSFListContext *lst = bsf->priv_data;
@@ -398,6 +407,7 @@ const AVBitStreamFilter ff_list_bsf = {
         .priv_class     = &bsf_list_class,
         .init           = bsf_list_init,
         .filter         = bsf_list_filter,
+        .flush          = bsf_list_flush,
         .close          = bsf_list_close,
 };
 



More information about the ffmpeg-cvslog mailing list