[FFmpeg-cvslog] motion-test: do not use getopt()

Anton Khirnov git at videolan.org
Mon Jul 9 22:43:10 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Jul  9 08:15:34 2012 +0200| [82f82ccfc822e8548cad233d629e537a3131529c] | committer: Diego Biurrun

motion-test: do not use getopt()

It is not available on all systems and using argc/argv directly actually
makes the code simpler.

Signed-off-by: Diego Biurrun <diego at biurrun.de>

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

 libavcodec/motion-test.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c
index bf63182..2c3a0af 100644
--- a/libavcodec/motion-test.c
+++ b/libavcodec/motion-test.c
@@ -119,15 +119,9 @@ int main(int argc, char **argv)
     int flags[2] = { AV_CPU_FLAG_MMX, AV_CPU_FLAG_MMX2 };
     int flags_size = HAVE_MMX2 ? 2 : 1;
 
-    for(;;) {
-        c = getopt(argc, argv, "h");
-        if (c == -1)
-            break;
-        switch(c) {
-        case 'h':
-            help();
-            return 1;
-        }
+    if (argc > 1) {
+        help();
+        return 1;
     }
 
     printf("Libav motion test\n");



More information about the ffmpeg-cvslog mailing list