summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-01 13:16:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-01 13:25:50 +0200
commit30aa004f0cf0b5ef4c81853ce26af691f61e639a (patch)
tree7e387aed6c4061e6cccc9dd35a3197ad169305c2 /libswresample
parentbea3d19fbb81048e830e1e56e25207299589b394 (diff)
swr-test: allow randomizing mode differently each run.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample_test.c7
1 files changed, 7 insertions, 0 deletions
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;
}