[FFmpeg-devel] [PATCH] avfilter: Fix handling duplicate classes

Clément Bœsch ubitux at gmail.com
Mon Apr 15 00:52:34 CEST 2013


On Sun, Apr 14, 2013 at 09:47:47PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavfilter/avfilter.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index f392613..35250f1 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -477,8 +477,13 @@ static const AVClass *filter_child_class_next(const AVClass *prev)
>  
>      /* find next filter with specific options */
>      while ((f = avfilter_next(f)))
> -        if (f->priv_class)
> -            return f->priv_class;
> +        if (f->priv_class) {
> +            AVFilter *f2 = NULL;
> +            while ((f2 = avfilter_next(f2)) && f->priv_class!=f2->priv_class)
> +                ;
> +            if(f==f2)
> +                return f->priv_class;
> +        }
>  

I'd personally prefer to assert.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130415/21bf23bf/attachment.asc>


More information about the ffmpeg-devel mailing list