[FFmpeg-devel] [PATCH] ffplay: remove -x and -y options

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Apr 11 12:38:20 CEST 2011


The interaction logic with -vf was wrong. In order to avoid the burden
of maintaining two distinct logic paths the options are removed in
favor of the use of -vf and the scale filter.

Fix trac ticket #45.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
---
 doc/ffplay.texi |    5 +++--
 ffplay.c        |   17 ++++++-----------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index e0518b8..b82df32 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -34,10 +34,11 @@ various FFmpeg APIs.
 
 @table @option
 @item -x @var{width}
-Force displayed width.
 @item -y @var{height}
-Force displayed height.
+The -x and -y options have been removed. Use -vf
+scale=@var{width}:@var{height} instead.
 @item -s @var{size}
+
 Set frame size (WxH or abbreviation), needed for videos which don't
 contain a header with the frame size like raw YUV.
 @item -an
diff --git a/ffplay.c b/ffplay.c
index 04e0343..acf1804 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2916,16 +2916,11 @@ static void opt_frame_size(const char *arg)
     }
 }
 
-static int opt_width(const char *opt, const char *arg)
+static int opt_xy(const char *opt, const char *arg)
 {
-    screen_width = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX);
-    return 0;
-}
-
-static int opt_height(const char *opt, const char *arg)
-{
-    screen_height = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX);
-    return 0;
+    av_log(NULL, AV_LOG_ERROR,
+           "Option '%s' has been removed, use -vf and the scale filter instead.\n", opt);
+    return AVERROR(EINVAL);
 }
 
 static void opt_format(const char *arg)
@@ -2993,8 +2988,8 @@ static int opt_thread_count(const char *opt, const char *arg)
 
 static const OptionDef options[] = {
 #include "cmdutils_common_opts.h"
-    { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
-    { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" },
+    { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_xy}, "Removed, use the scale filter instead", "width" },
+    { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_xy}, "Removed, use the scale filter instead", "height" },
     { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
     { "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" },
     { "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" },
-- 
1.7.2.3



More information about the ffmpeg-devel mailing list