[FFmpeg-devel] [PATCH] libavfilter-soc: Clean up properly in the movie source

Benoit Fouet benoit.fouet
Wed May 6 10:58:32 CEST 2009


On 05/06/2009 09:41 AM, Martin Storsj? wrote:
> Hi,
>
> As in the subject; this patch makes the movie source filter clean up 
> properly when uninited.
>   

> diff --git a/vsrc_movie.c b/vsrc_movie.c
> index e6c2cd0..1aeac95 100644
> --- a/vsrc_movie.c
> +++ b/vsrc_movie.c
> @@ -257,6 +257,12 @@ static av_cold void uninit(AVFilterContext *ctx)
>  {
>      MovieContext *mv = ctx->priv;
> 
> +    if(mv->pCodecCtx)
> +        avcodec_close(mv->pCodecCtx);
> +    if(mv->pFormatCtx)
> +        av_close_input_file(mv->pFormatCtx);
> +    if(mv->pFrame)
> +        av_freep(&mv->pFrame);
>

this if is unneeded.

>      if(mv->pic)
>          avfilter_unref_pic(mv->pic);
>  }
>

Ben



More information about the ffmpeg-devel mailing list