On Fri, 2 Sep 2011 12:33:26 -0700, Alex Converse <[email protected]> 
wrote:
> On Thu, Sep 1, 2011 at 2:03 AM, Anton Khirnov <[email protected]> wrote:
> > ---
> >  cmdutils.c |   10 ++++++++++
> >  cmdutils.h |   13 +++++++++++++
> >  2 files changed, 23 insertions(+), 0 deletions(-)
> >
> > diff --git a/cmdutils.c b/cmdutils.c
> > index 70a7ff4..d126c82 100644
> > --- a/cmdutils.c
> > +++ b/cmdutils.c
> > @@ -234,6 +234,16 @@ unknown_opt:
> >      * a global var*/
> >     dst = po->flags & (OPT_OFFSET|OPT_SPEC) ? (uint8_t*)obj + po->u.off : 
> > po->u.dst_ptr;
> >
> > +    if (po->flags & OPT_SPEC) {
> > +        SpecifierOpt **so = dst;
> > +        char *p = strchr(opt, ':');
> > +
> > +        dstcount = (int*)(so + 1);
> > +        *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1);
> > +        (*so)[*dstcount - 1].specifier = av_strdup(p ? p + 1 : "");
> > +        dst = &(*so)[*dstcount - 1].u;
> > +    }
> > +
> >     if (po->flags & OPT_STRING) {
> >         char *str;
> >         str = av_strdup(arg);
> 
> Feel ugly but I don't have anything better to offer.
> 

Well yeah, but at least the ugliness is concentrated in one place. This
looks the least evil way to me.

Better solutions are of course welcome.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to