[FFmpeg-cvslog] swr-test: allow randomizing mode differently each run.

Michael Niedermayer git at videolan.org
Tue May 1 13:30:47 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May  1 13:16:13 2012 +0200| [30aa004f0cf0b5ef4c81853ce26af691f61e639a] | committer: Michael Niedermayer

swr-test: allow randomizing mode differently each run.

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

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

 libswresample/swresample_test.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/libswresample/swresample_test.c b/libswresample/swresample_test.c
index 6a6ba12..35eede2 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;
     }



More information about the ffmpeg-cvslog mailing list