[Ffmpeg-devel] libavcodec help

Michael Niedermayer michaelni
Tue Nov 1 20:13:15 CET 2005


Hi

On Tue, Nov 01, 2005 at 08:02:11PM +0100, Guillaume POIRIER wrote:
> Hi,
> 
> On 11/1/05, Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > Hi,
> > On Tue, Nov 01, 2005 at 07:48:05PM +0100, Guillaume POIRIER wrote:
> > > I like the idea. I'll commit this patch in the coming days if nobody
> > > objects (and once the CVS is back to business (right now there's a
> > > lock in /cvsroot/ffmpeg/ffmpeg/libavcodec which prevents any commit
> > > from happening).
> >
> > The idea might be good, the patch is not. It contains two cosmetics, and
> > esp. it uses asprintf, which is an non-portable GNU-extension.
> 
> I saw the cosmetics and I meant to remove it myself before committing it.
> 
> What function do you suggest instead of asprintf? snprintf?

none

just write something like

switch(opt->type){
case FF_OPT_TYPE_FLAGS: str="<flags>"; break;
...
}
av_log(..., str, ...)

or 

static const char *str[]= {
    [FF_OPT_TYPE_FLAGS] = "<flags>",
...
}
av_log(..., str[opt->type], ...)

-- 
Michael





More information about the ffmpeg-devel mailing list