Commit a75e1034 authored by Ramiro Polla's avatar Ramiro Polla

Add -fpre option to take a preset file as parameter. The -[avs]pre options no

longer accept filenames, and -fpre should be used instead.

Originally committed as revision 20435 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d71ad089
...@@ -3775,6 +3775,7 @@ static int opt_preset(const char *opt, const char *arg) ...@@ -3775,6 +3775,7 @@ static int opt_preset(const char *opt, const char *arg)
FFMPEG_DATADIR, FFMPEG_DATADIR,
}; };
if (*opt != 'f') {
for(i=!base[0]; i<2 && !f; i++){ for(i=!base[0]; i<2 && !f; i++){
snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg); snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg);
f= fopen(filename, "r"); f= fopen(filename, "r");
...@@ -3786,8 +3787,7 @@ static int opt_preset(const char *opt, const char *arg) ...@@ -3786,8 +3787,7 @@ static int opt_preset(const char *opt, const char *arg)
f= fopen(filename, "r"); f= fopen(filename, "r");
} }
} }
if(!f && ((arg[0]=='.' && arg[1]=='/') || arg[0]=='/' || } else {
is_dos_path(arg))){
av_strlcpy(filename, arg, sizeof(filename)); av_strlcpy(filename, arg, sizeof(filename));
f= fopen(filename, "r"); f= fopen(filename, "r");
} }
...@@ -3945,6 +3945,7 @@ static const OptionDef options[] = { ...@@ -3945,6 +3945,7 @@ static const OptionDef options[] = {
{ "apre", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_preset}, "set the audio options to the indicated preset", "preset" }, { "apre", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_preset}, "set the audio options to the indicated preset", "preset" },
{ "vpre", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_preset}, "set the video options to the indicated preset", "preset" }, { "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" }, { "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 to the indicated preset file", "filename" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" }, { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ NULL, }, { NULL, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment