[FFmpeg-cvslog] r25303 - trunk/ffmpeg.c

Diego Biurrun diego
Sat Oct 2 16:24:04 CEST 2010


On Sat, Oct 02, 2010 at 12:14:58AM +0200, Stefano Sabatini wrote:
> On date Saturday 2010-10-02 00:05:11 +0200, Aurelien Jacobs wrote:
> > On Fri, Oct 01, 2010 at 11:59:14PM +0200, Stefano Sabatini wrote:
> > > On date Friday 2010-10-01 23:54:20 +0200, aurel wrote:
> > > > 
> > > > Log:
> > > > ffmpeg: dynamically allocate bitstream_filters
> > > > 
> > > > --- trunk/ffmpeg.c	Fri Oct  1 23:52:09 2010	(r25302)
> > > > +++ trunk/ffmpeg.c	Fri Oct  1 23:54:20 2010	(r25303)
> > > [...]
> > > > @@ -3413,6 +3415,7 @@ static void new_video_stream(AVFormatCon
> > > >  
> > > >      avcodec_get_context_defaults3(st->codec, codec);
> > > > +    bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
> > > >      bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
> > > >      video_bitstream_filters= NULL;
> > > >  
> > > > @@ -3554,6 +3557,7 @@ static void new_audio_stream(AVFormatCon
> > > >  
> > > > +    bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
> > > >      bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
> > > >      audio_bitstream_filters= NULL;
> > > >  
> > > > @@ -3622,6 +3626,7 @@ static void new_subtitle_stream(AVFormat
> > > >  
> > > > +    bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
> > > 
> > > Uhm, superlong lines...
> > 
> > That's exactly why I originally had a wrapping macro which made this
> > line looks like this:
> > 
> >     GROW_ARRAY(bitstream_filters[nb_output_files], oc->nb_streams);
> > 
> > But wrapping macros are not really appreciated...
> > I could break up the line but it wouldn't be much nicer IMO:
> > 
> >     bitstream_filters[nb_output_files]
> >         = grow_array(bitstream_filters[nb_output_files],
> >                      sizeof(*bitstream_filters[nb_output_files]),
> >                      &nb_bitstream_filters[nb_output_files], oc->nb_streams);
> > 
> > If you want me to commit this version, say so.
> 
> Only if it doesn't bother you, and I'm not a fan of castigated
> not-longer-than-80-chars lines but these ones are sort of a record
> (and expect some remarks from Diego if you won't ;-).

Haha, trying to troll me into replying? :)

I don't like breaking down assignments like you propose above.
The following is over 80 characters, but still better than what
we have right now:

bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files],
                                                sizeof(*bitstream_filters[nb_output_files]),
                                                &nb_bitstream_filters[nb_output_files],
                                                oc->nb_streams);

Diego



More information about the ffmpeg-cvslog mailing list