cmdutils: preserve unchanged log flags when setting AV_LOG_SKIP_REPEATED
authortue46wsdgxfjrt <jfbvxt@gmail.com>
Fri, 28 Feb 2014 00:36:09 +0000 (16:36 -0800)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Apr 2014 17:21:59 +0000 (19:21 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cmdutils.c

index ebbbe7f..934fd4c 100644 (file)
@@ -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)