swr-test: allow randomizing mode differently each run.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 1 May 2012 11:16:13 +0000 (13:16 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 1 May 2012 11:25:50 +0000 (13:25 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/swresample_test.c

index 6a6ba12..35eede2 100644 (file)
@@ -24,6 +24,9 @@
 #include "libavutil/audioconvert.h"
 #include "libavutil/opt.h"
 #include "swresample.h"
+
+#undef time
+#include "time.h"
 #undef fprintf
 
 #define SAMPLES 1000
@@ -245,6 +248,10 @@ int main(int argc, char **argv){
             return 0;
         }
         num_tests = strtol(argv[1], NULL, 0);
+        if(num_tests < 0) {
+            num_tests = -num_tests;
+            rand_seed = time(0);
+        }
         if(num_tests<= 0 || num_tests>max_tests)
             num_tests = max_tests;
     }