[FFmpeg-devel] [PATCH] enc is not a good name for a decoder context

Stefano Sabatini stefano.sabatini-lala
Tue Feb 16 21:05:35 CET 2010


On date Tuesday 2010-02-16 03:08:35 +0100, Michael Niedermayer encoded:
> On Mon, Feb 15, 2010 at 07:27:32PM -0500, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Mon, Feb 15, 2010 at 7:23 PM, Stefano Sabatini
> > <stefano.sabatini-lala at poste.it> wrote:
> > > On date Wednesday 2009-12-30 00:14:31 +0100, Stefano Sabatini encoded:
> > >> On date Tuesday 2009-12-29 01:21:13 +0100, Michael Niedermayer encoded:
> > >> > avctx
> > >>
> > >> Mmh.. no I don't believe that's a good name either, try to ask what
> > >> that could mean to someone which never looked at the FFmpeg source...
> > >> dec_ctx or even codec_ctx are way more intelligible names IMO...
> > >
> > > Ping?
> > 
> > I agree anything is better than enc. AVCodecContext already tells us
> > it's a avctx. I'd go for dec also, maybe decctx.
> 
> dec is highly ambigous it can be a AVCodec, AVCodecContext or some struct
> private to ffplay.c or even a char * 
> avctx is much clearer
> and you only know the type when you look it up not when you see a
> variable used somewhere, this takes time and makes reading code
> harder
> 
> also iam maintainer of the file, making it hard to read for me is not
> a good idea at all
> thats besides that avctx is very widespreadly used for AVCodecContext
> starting a bikeshed rename in ffplay is really silly
> and renaming all avctx in all decoders to dec is also silly because
> dec or decctx are very ambigous in a decoder.

I don't see how dec_ctx can be ambiguos, DECoder ConTeXt is its
natural interpretation, avctx is much more ambiguous (Audio Video
ConTeXt, context of what?).

That said, I agree that bikeshedding on this would be silly and I'm
reasonably fine with avctx so if you prefer avctx over dec_ctx I'll
apply that.

Regards.
-- 
FFmpeg = Faithful and Fantastic Majestic Puristic Ecumenical Guru



More information about the ffmpeg-devel mailing list