[FFmpeg-devel] [FFmpeg-cvslog] rawdec: factor video demuxer definitions into a macro.

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon May 30 00:33:35 CEST 2011


On date Monday 2011-05-30 00:14:11 +0200, Michael Niedermayer encoded:
> On Sun, May 29, 2011 at 03:14:02PM -0400, Mike Scheutzow wrote:
> > Anton Khirnov wrote:
> >> ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May 25 08:14:13 2011 +0200| [fa4924a35818b2564050119ed7c14cbdd2b56065] | committer: Anton Khirnov
> >>
> >> rawdec: factor video demuxer definitions into a macro.
> >>
> >>   
> >>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa4924a35818b2564050119ed7c14cbdd2b56065
> >>>     
> >> ---
> >>
> >>  libavformat/cavsvideodec.c |   11 +----------
> >>  libavformat/diracdec.c     |   11 +----------
> >>  libavformat/dnxhddec.c     |   11 +----------
> >>  libavformat/h261dec.c      |   12 +-----------
> >>  libavformat/h263dec.c      |   12 +-----------
> >>  libavformat/h264dec.c      |   12 +-----------
> >>  libavformat/m4vdec.c       |   12 +-----------
> >>  libavformat/mpegvideodec.c |   11 +----------
> >>  libavformat/rawdec.c       |   23 ++---------------------
> >>  libavformat/rawdec.h       |   12 ++++++++++++
> >>  10 files changed, 22 insertions(+), 105 deletions(-)
> >> ...
> >>
> >>   
> >
> > This patch feels like a step backwards to me.
> >
> > It is simply documentation removal, for no benefit.
> >
> > How is it better that developers have to decode another level of  
> > indirection when reading source code?
> 
> i agree
> anton, could you comment?

I actually like this patch, reduces line count and avoids code
duplication, in case of changes you need to change the code only in
one point (and avoid possibly bugs in case this doesn't happen), also
allows to spot that the various codecs are actually using the same
code. On the other hand I see that it introduces another level of
indirection and makes the code more opaque, so it's mixed feeling.
-- 
FFmpeg = Fundamentalist Freaking Mere Peaceful Educated Geisha


More information about the ffmpeg-devel mailing list