From 30aa004f0cf0b5ef4c81853ce26af691f61e639a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 1 May 2012 13:16:13 +0200 Subject: [PATCH] swr-test: allow randomizing mode differently each run. Signed-off-by: Michael Niedermayer --- libswresample/swresample_test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libswresample/swresample_test.c b/libswresample/swresample_test.c index 6a6ba128b6..35eede231c 100644 --- a/libswresample/swresample_test.c +++ b/libswresample/swresample_test.c @@ -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; }