[MPlayer-cvslog] r32992 - in trunk: fmt-conversion.c fmt-conversion.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Mar 2 08:44:57 CET 2011


On Wed, Mar 02, 2011 at 12:37:06AM +0100, Alexander Strasser wrote:
> reimar wrote:
> > Author: reimar
> > Date: Tue Mar  1 22:44:15 2011
> > New Revision: 32992
> > 
> > Log:
> > Add conversion functions to and from AVSampleFormat.
> > 
> > Modified:
> >    trunk/fmt-conversion.c
> >    trunk/fmt-conversion.h
> > 
> > Modified: trunk/fmt-conversion.c
> > ==============================================================================
> [...]
> > +enum AVSampleFormat affmt2samplefmt(int fmt)
> > +{
> > +    char str[50];
> > +    int i;
> > +    enum AVSampleFormat sample_fmt;
> > +    for (i = 0; samplefmt_conversion_map[i].fmt; i++)
> > +        if (samplefmt_conversion_map[i].fmt == fmt)
> > +            break;
> > +    sample_fmt = samplefmt_conversion_map[i].sample_fmt;
> > +    if (sample_fmt == PIX_FMT_NONE)
> 
>   AV_SAMPLE_FMT_NONE, isn't it?

Of course, fixed.

> [...]
> > Modified: trunk/fmt-conversion.h
> > ==============================================================================
> > --- trunk/fmt-conversion.h	Tue Mar  1 12:02:48 2011	(r32991)
> > +++ trunk/fmt-conversion.h	Tue Mar  1 22:44:15 2011	(r32992)
> > @@ -21,8 +21,11 @@
> >  
> >  #include "config.h"
> >  #include "libavutil/avutil.h"
> > +#include "libavutil/samplefmt.h"
> >  
> >  enum PixelFormat imgfmt2pixfmt(int fmt);
> >  int pixfmt2imgfmt(enum PixelFormat pix_fmt);
> > +enum AVSampleFormat affmt2samplefmt(int fmt);
> > +int samplefmt2affmt(enum AVSampleFormat sample_fmt);
> 
>   Maybe naming it avsamplefmt in the function names would have been a bit
> more descriptive?

I thought it matches better the pixfmt names, is shorter and
avoids potential clashes with FFmpeg's av* namespace.
I don't really mind either way though.


More information about the MPlayer-cvslog mailing list