[FFmpeg-devel] [PATCH 1/5] Change eval internal functions, ff_parse_expr() and ff_parse_and_eval_expr() interface.

Michael Niedermayer michaelni
Tue May 18 21:29:56 CEST 2010


On Tue, May 18, 2010 at 08:38:23PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2010-05-18 17:27:37 +0200, Michael Niedermayer encoded:
> > On Tue, May 18, 2010 at 12:56:53AM +0200, Stefano Sabatini wrote:
> > [...]
> > >  opt.c |    2 ++
> > >  1 file changed, 2 insertions(+)
> > > 11b07e9a34d65b8e88f47b5fd2d9af456258620b  0002-Silence-logging-when-evaluating-the-expression-for-b.patch
> > > >From c18ac9ee11ca03ab36e5acf2b72ecfc537caaced Mon Sep 17 00:00:00 2001
> > > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > > Date: Tue, 18 May 2010 00:31:01 +0200
> > > Subject: [PATCH 2/4] Silence logging when evaluating the expression for buf in
> > >  av_set_string3().
> > > 
> > > ---
> > >  libavcodec/opt.c |    2 ++
> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/libavcodec/opt.c b/libavcodec/opt.c
> > > index 5b56bc8..844c0ec 100644
> > > --- a/libavcodec/opt.c
> > > +++ b/libavcodec/opt.c
> > > @@ -155,7 +155,9 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
> > >                  buf[i]= val[i];
> > >              buf[i]=0;
> > >  
> > > +            av_set_int(obj, "log_level_offset", AV_LOG_DEBUG - AV_LOG_QUIET);
> > >              d = ff_parse_and_eval_expr(buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, obj);
> > > +            av_set_int(obj, "log_level_offset", 0);
> > 
> > not ok, obj is not owned by this code. Other code might via a seperate
> > thread print via obj at the same time.
> 
> So please suggest what to do.

the problem appears to me that eval prints using an outside context and
not its own context.
I do not know if changing this would lead to other problems or how much
work that would be

one way to fix this i see would be to seperate context allocation
from the rest.
We could also (thats independant) ff_parse_and_eval_expr() to take a
log_level_offset argument



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100518/2bc3e985/attachment.pgp>



More information about the ffmpeg-devel mailing list