A few weeks ago I had a problem with some eval code and it was pointed out that i need to escape the ','.

So here is a small patch that needs passing on to the devel guys to have a look at.

All this does is to ignore the fixed tokens when inside parenthesis, so this works now

-filter_complex '[0:v] scale=160:90 [out], [v:0][out] overlay=x=mod(10,2):y=20'

patch is here

diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 4c068f5..e19db8f 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -150,14 +150,26 @@ char *av_get_token(const char **buf, const char *term)
 {
     char *out     = av_malloc(strlen(*buf) + 1);
     char *ret     = out, *end = out;
+    int   p_count = 0;
+
     const char *p = *buf;
     if (!out)
         return NULL;
     p += strspn(p, WHITESPACES);

-    while (*p && !strspn(p, term)) {
+    while (*p && (!strspn(p, term) || p_count)) {
         char c = *p++;
-        if (c == '\\' && *p) {
+        if (c == ')') {
+            if( p_count) {
+                p_count--;
+            }
+            *out++ = c;
+        }
+        else if (c == '(') {
+            p_count++;
+            *out++ = c;
+        }
+        else if (c == '\\' && *p) {
             *out++ = *p++;
             end    = out;
         } else if (c == '\'') {

--
BR

Joolz
_______________________________________________
ffmpeg-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to