[FFmpeg-cvslog] lavfi: do not warn inappropriately with aevalsrc.

Clément Bœsch git at videolan.org
Thu Apr 11 18:03:02 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Apr 11 17:59:54 2013 +0200| [23a750c9940e3dd25d779bddc732c124a980c17d] | committer: Clément Bœsch

lavfi: do not warn inappropriately with aevalsrc.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23a750c9940e3dd25d779bddc732c124a980c17d
---

 libavfilter/avfilter.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 18efe80..334598d 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -763,6 +763,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
             char *copy = av_strdup(args);
             char *p    = copy;
             int nb_leading = 0; // number of leading colons to skip
+            int deprecated = 0;
 
             if (!copy) {
                 ret = AVERROR(ENOMEM);
@@ -784,12 +785,10 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
                 p++;
             }
 
-            if (strchr(p, ':')) {
-                av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
-                       "'|' to separate the list items.\n");
-            }
+            deprecated = strchr(p, ':') != NULL;
 
             if (!strcmp(filter->filter->name, "aevalsrc")) {
+                deprecated = 0;
                 while ((p = strchr(p, ':')) && p[1] != ':') {
                     const char *epos = strchr(p + 1, '=');
                     const char *spos = strchr(p + 1, ':');
@@ -798,14 +797,22 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
                         p++;
                         break;
                     }
+                    /* next token does not contain a '=', assume a channel expression */
+                    deprecated = 1;
                     *p++ = '|';
                 }
-                if (p && *p == ':')
+                if (p && *p == ':') { // double sep '::' found
+                    deprecated = 1;
                     memmove(p, p + 1, strlen(p));
+                }
             } else
             while ((p = strchr(p, ':')))
                 *p++ = '|';
 
+            if (deprecated)
+                av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
+                       "'|' to separate the list items.\n");
+
             av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);
             ret = process_options(filter, &options, copy);
             av_freep(&copy);



More information about the ffmpeg-cvslog mailing list