aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-01-06 00:31:47 -0300
committerJames Almer <jamrial@gmail.com>2019-01-06 15:11:59 -0300
commit674b59c07515409eb815c91bee90fe4151905a10 (patch)
tree4794c89eb95ae3d91901cf3820f01cd26185118f
parent2d580d727cf2f6e857a9e46fd2dcdee6473e7c3c (diff)
downloadffmpeg-674b59c07515409eb815c91bee90fe4151905a10.tar.gz
avcodec/bsf_list: implement a AVBSFContext.flush callback
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/bsf.c10
1 files changed, 10 insertions, 0 deletions
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,
};