[FFmpeg-devel] [PATCH] Define a set_preset() function shared between ffmpeg.c and ffserver.c, factorize.

Stefano Sabatini stefano.sabatini-lala
Sat Oct 30 22:13:15 CEST 2010


On date Friday 2010-10-29 22:26:46 +0200, Michael Niedermayer encoded:
> On Thu, Oct 28, 2010 at 07:21:39PM -0700, Stefano Sabatini wrote:
[...]
> > +static int set_preset_opt(const char *opt, const char *arg, void *priv)
> >  {
> > +    int ret = 0;
> > +    struct presets_context *ctx = priv;
> >  
> > +    if (!strcmp(opt, "acodec")){
> > +        *ctx->audio_id = opt_audio_codec(arg);
> > +    } else if (!strcmp(opt, "vcodec")){
> > +        *ctx->video_id = opt_video_codec(arg);
> > +    } else {
> > +        ret = ffserver_opt_default(opt, arg, ctx->avctx, ctx->type);
> >      }
> >  
> > +    return ret;
> > +}
> 
> i dont think this mess used in callbacks is a good idea
> IMHO to factorize the code ffserver and ffmpeg should be made more similar first
> but maybe there are issues with this, i dont know ive not really investigated
> this

Dropped.
-- 
FFmpeg = Fantastic & Frenzy Maxi Power Exciting Gem



More information about the ffmpeg-devel mailing list