[libav-commits] audiogen: allow specifying random seed as a commandline parameter.

Anton Khirnov git at libav.org
Sat Jul 28 14:39:54 CEST 2012


Module: libav
Branch: master
Commit: 67ef5f4eb54297cb0448653ee59993c790c4cd3e

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Wed Jul  4 06:32:30 2012 +0200

audiogen: allow specifying random seed as a commandline parameter.

---

 tests/audiogen.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/audiogen.c b/tests/audiogen.c
index 8d27dc2..acb380d 100644
--- a/tests/audiogen.c
+++ b/tests/audiogen.c
@@ -144,8 +144,8 @@ int main(int argc, char **argv)
     int nb_channels = 2;
     char *ext;
 
-    if (argc < 2 || argc > 4) {
-        printf("usage: %s file [<sample rate> [<channels>]]\n"
+    if (argc < 2 || argc > 5) {
+        printf("usage: %s file [<sample rate> [<channels>] [<random seed>]]\n"
                "generate a test raw 16 bit audio stream\n"
                "If the file extension is .wav a WAVE header will be added.\n"
                "default: 44100 Hz stereo\n", argv[0]);
@@ -168,6 +168,9 @@ int main(int argc, char **argv)
         }
     }
 
+    if (argc > 4)
+        seed = atoi(argv[4]);
+
     outfile = fopen(argv[1], "wb");
     if (!outfile) {
         perror(argv[1]);



More information about the libav-commits mailing list