[FFmpeg-devel] [PATCH 10/11] Add -pre option.

Stefano Sabatini stefano.sabatini-lala
Fri Nov 12 19:31:48 CET 2010


---
 ffmpeg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 26bc0d7..08ebf8d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4083,7 +4083,7 @@ static int opt_preset(const char *opt, const char *arg)
     char filename[1000], tmp[1000], tmp2[1000], line[1000];
     char *codec_name = *opt == 'v' ? video_codec_name :
                        *opt == 'a' ? audio_codec_name :
-                                     subtitle_codec_name;
+                       *opt == 's' ? subtitle_codec_name : NULL;
 
     if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
         fprintf(stderr, "File for preset '%s' not found\n", arg);
@@ -4237,6 +4237,7 @@ static const OptionDef options[] = {
     { "vpre", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_preset}, "set the video options to the indicated preset", "preset" },
     { "spre", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_preset}, "set the subtitle options to the indicated preset", "preset" },
     { "fpre", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_preset}, "set options from indicated preset file", "filename" },
+    { "pre",  OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_preset}, "set options from a preset file", "preset" },
 
     { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
     { NULL, },
-- 
1.7.1




More information about the ffmpeg-devel mailing list