[Ffmpeg-devel] Changing "-vstats" option behaviour

Stefano Sabatini stefano.sabatini-lala
Fri Apr 20 12:25:27 CEST 2007


On date Friday 2007-04-20 17:42:04 +0800, Limin Wang encoded:
> Hi,
> 
> >      double ti1, bitrate, avg_bitrate;
> >  
> > +    /* this is executed just the first time do_video_stats is called */
> >      if (!fvstats) {
> > -        today2 = time(NULL);
> > -        today = localtime(&today2);
> > -        snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour,
> > -                                               today->tm_min,
> > -                                               today->tm_sec);
> > -        fvstats = fopen(filename,"w");
> > +        fvstats = fopen(vstats_filename, "w");
> 
> fclose fvstats in the end?
The original code didn't close it, to do it we need to make fvstats global.

> 
> > +static void opt_vstats_file (const char *arg)
> > +{
> > +    av_free (vstats_filename);
> > +    vstats_filename=av_strdup (arg);
> 
> av_free vstats_filename in the end?
OK.

Cheers
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vstats_file-3.patch
Type: text/x-diff
Size: 4290 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070420/07fc8dbb/attachment.patch>



More information about the ffmpeg-devel mailing list