[FFmpeg-cvslog] lavf: flush the output AVIOContext in av_write_trailer().

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Sep 16 17:17:13 CEST 2012


On Sun, Sep 16, 2012 at 02:29:19PM +0200, Anton Khirnov wrote:
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index b555ad0..b5b49c9 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -3270,6 +3270,10 @@ int av_write_trailer(AVFormatContext *s)
>  
>      if (s->oformat->write_trailer)
>          ret = s->oformat->write_trailer(s);
> +
> +    if (!(s->oformat->flags & AVFMT_NOFILE))
> +        avio_flush(s->pb);
> +

We now have the flush twice, once in this variable, which
does not check that s->pb is not NULL (but instead checks
for NOFILE which is IMHO at best indirectly related and no static
analysis tool will be able to figure that connection out) and
also does not flush on failure, and the code I added back then.
I think one should go (and I am obviously biased towards which).


More information about the ffmpeg-cvslog mailing list