[FFmpeg-devel] [PATCH 5/7] ffmpeg: dynamically allocate stream_maps

Aurelien Jacobs aurel
Thu Aug 19 15:55:20 CEST 2010


On Thu, Aug 19, 2010 at 02:41:37PM +0100, M?ns Rullg?rd wrote:
> Aurelien Jacobs <aurel at gnuage.org> writes:
> 
> > On Wed, Aug 18, 2010 at 10:57:41PM +0200, Michael Niedermayer wrote:
> >> On Fri, Aug 13, 2010 at 08:24:18PM +0200, Aur?lien Jacobs wrote:
> >> > From: Aurelien Jacobs <aurel at gnuage.org>
> >> > 
> >> > ---
> >> >  ffmpeg.c |    8 +++++---
> >> >  1 files changed, 5 insertions(+), 3 deletions(-)
> >> > 
> >> > diff --git a/ffmpeg.c b/ffmpeg.c
> >> > index dcaaecf..9e55f01 100644
> >> > --- a/ffmpeg.c
> >> > +++ b/ffmpeg.c
> >> > @@ -117,8 +117,8 @@ static AVCodec **output_codecs = NULL;
> >> >  static int nb_output_files = 0;
> >> >  static int nb_output_codecs = 0;
> >> >  
> >> > -static AVStreamMap stream_maps[MAX_FILES*MAX_STREAMS];
> >> > -static int nb_stream_maps;
> >> > +static AVStreamMap *stream_maps = NULL;
> >> 
> >> > +static int nb_stream_maps = 0;
> >> 
> >> unneeded
> >
> > It is actually used. Hidden behind the GROW_ARRAY() macro :-(
> > So yes, I understand why you don't like such kind of macro...
> 
> He meant the =0 initialiser is unnecessary.

Oh, sure it is unnecessary. But almost all the other static vars in
ffmpeg.c are initialized to 0, so I did the same for consistency.
Should I remove all "static * = 0" from ffmpeg.c ?

Aurel



More information about the ffmpeg-devel mailing list