[FFmpeg-cvslog] cmdutils: preserve unchanged log flags when setting AV_LOG_SKIP_REPEATED

tue46wsdgxfjrt git at videolan.org
Sat Apr 26 19:45:38 CEST 2014


ffmpeg | branch: master | tue46wsdgxfjrt <jfbvxt at gmail.com> | Thu Feb 27 16:36:09 2014 -0800| [262ea965e73eca0012b06bb06f80e7d7f54f05b6] | committer: Michael Niedermayer

cmdutils: preserve unchanged log flags when setting AV_LOG_SKIP_REPEATED

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 cmdutils.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cmdutils.c b/cmdutils.c
index ebbbe7f..934fd4c 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -834,10 +834,17 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
     };
     char *tail;
     int level;
+    int flags;
     int i;
 
+    flags = av_log_get_flags();
     tail = strstr(arg, "repeat");
-    av_log_set_flags(tail ? 0 : AV_LOG_SKIP_REPEATED);
+    if (tail)
+        flags &= ~AV_LOG_SKIP_REPEATED;
+    else
+        flags |= AV_LOG_SKIP_REPEATED;
+
+    av_log_set_flags(flags);
     if (tail == arg)
         arg += 6 + (arg[6]=='+');
     if(tail && !*arg)



More information about the ffmpeg-cvslog mailing list