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

Paul B Mahol onemda at gmail.com
Sun Jan 6 11:08:16 EET 2019


On 1/6/19, James Almer <jamrial at gmail.com> wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/bsf.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
> index 03841da682..41dde4dcc8 100644
> --- a/libavcodec/bsf.c
> +++ b/libavcodec/bsf.c
> @@ -350,6 +350,16 @@ static int bsf_list_filter(AVBSFContext *bsf, AVPacket
> *out)
>      return ret;
>  }
>
> +static void bsf_list_flush(AVBSFContext *bsf)
> +{
> +    BSFListContext *lst = bsf->priv_data;
> +    int i;
> +
> +    for (i = 0; i < lst->nb_bsfs; ++i)

Weird style, please use i++
Also use for (int 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 +408,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,
>  };
>
> --
> 2.20.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list