[FFmpeg-cvslog] Add a dummy option -i to ffplay so that it is easy to switch between ffmpeg -i "file" and ffplay -i "file".

Benjamin Larsson git
Tue Mar 8 18:06:25 CET 2011


ffmpeg | branch: master | Benjamin Larsson <benjamin at southpole.se> | Tue Mar  8 15:29:46 2011 +0100| [76d4c1676f6367df2847d59754717fb076d98f43] | committer: Michael Niedermayer

Add a dummy option -i to ffplay so that it is easy to switch between ffmpeg -i "file" and ffplay -i "file".

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

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

 cmdutils.c |    2 ++
 cmdutils.h |    1 +
 ffplay.c   |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index e1532cb..d44aa9e 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -214,6 +214,8 @@ unknown_opt:
                     fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
                     exit(1);
                 }
+            } else if (po->flags & OPT_DUMMY) {
+                /* Do nothing for this option */
             } else {
                 po->u.func_arg(arg);
             }
diff --git a/cmdutils.h b/cmdutils.h
index b35b99b..adc4403 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -122,6 +122,7 @@ typedef struct {
 #define OPT_FUNC2  0x0400
 #define OPT_INT64  0x0800
 #define OPT_EXIT   0x1000
+#define OPT_DUMMY  0x2000
      union {
         void (*func_arg)(const char *); //FIXME passing error code as int return would be nicer then exit() in the func
         int *int_arg;
diff --git a/ffplay.c b/ffplay.c
index 2c014f7..c777843 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3023,6 +3023,7 @@ static const OptionDef options[] = {
 #endif
     { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, {(void*)&rdftspeed}, "rdft speed", "msecs" },
     { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
+    { "i", OPT_DUMMY, NULL, "ffmpeg compatibility dummy option", ""},
     { NULL, },
 };
 




More information about the ffmpeg-cvslog mailing list