[FFmpeg-devel] [PATCH] avutil/eval: add function to track variable use

Michael Niedermayer michael at niedermayer.cc
Tue Nov 5 12:25:31 EET 2019


On Tue, Nov 05, 2019 at 10:13:52AM +0530, Gyan wrote:
> 
> 
> On 05-11-2019 04:35 am, Michael Niedermayer wrote:
> >On Sun, Nov 03, 2019 at 11:14:25AM +0530, Gyan wrote:
> >>Helps better identification of expr eval failures.
> >>
> >>Gyan
> >>  eval.c    |   21 +++++++++++++++++++++
> >>  eval.h    |   10 ++++++++++
> >>  version.h |    4 ++--
> >>  3 files changed, 33 insertions(+), 2 deletions(-)
> >>3dd142baa0144fd324eb9da8a9932cfd7ab2cd98  0001-avutil-eval-add-function-to-track-variable-use.patch
> >> From 19bce329464676f071707b99575f80e5abe1cd4c Mon Sep 17 00:00:00 2001
> >>From: Gyan Doshi <ffmpeg at gyani.pro>
> >>Date: Sat, 2 Nov 2019 20:16:42 +0530
> >>Subject: [PATCH] avutil/eval: add function to track variable use
> >>
> >>Helps avoid multiple evals of cross-referenced expressions
> >>and catch the use of non-applicable variables with respect
> >>to eval or special mode in filters
> >Maybe you should provide more details of the use case of this, maybe
> >with an example. Because it seems not completely obvious
> 
> An example of a cross-referenced expression would be 'y=x+rand(10)'. 
> Normally in filters, X would be evaluated first, then Y, then X again. The
> 2nd eval of X will overwrite the first and can generate a different value.
> With this func, we can avoid the 2nd eval.
> 
> I'm in the process of modifying the scale filter to allow 'n', 't', 'pos'
> variables in frame eval mode (it already supports dynamic output based on
> incoming frame changes) and I would like to catch their presence in init
> mode, since av_expr_eval will fail. Now, it can also fail due to circularly
> referenced expressions e.g. 'x=y+10' and 'y=x+10' and there's no way to
> detect whether it's this case or if inapplicable variables have been used.

please add this (or similar information) to the commit message

thx

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191105/d8893e1a/attachment.sig>


More information about the ffmpeg-devel mailing list