aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg_opt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-22 18:16:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-22 18:16:49 +0200
commit3db4c88ac1d54381514198f0dba139be1c07d77c (patch)
tree65c73faa839ed69190b0d94a6028cf23b74eef49 /ffmpeg_opt.c
parentbad953bc2df5e97a3c02ecff0d652bb4626512e8 (diff)
downloadffmpeg-3db4c88ac1d54381514198f0dba139be1c07d77c.tar.gz
ffmpeg/opt_preset: update to new option API for reading codec names.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index db5926ace3..dc89e67dc1 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1960,9 +1960,11 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
OptionsContext *o = optctx;
FILE *f=NULL;
char filename[1000], line[1000], tmp_line[1000];
- const char *codec_name = *opt == 'v' ? video_codec_name :
- *opt == 'a' ? audio_codec_name :
- subtitle_codec_name;
+ const char *codec_name = NULL;
+
+ tmp_line[0] = *opt;
+ tmp_line[1] = 0;
+ MATCH_PER_TYPE_OPT(codec_names, str, codec_name, NULL, tmp_line);
if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
if(!strncmp(arg, "libx264-lossless", strlen("libx264-lossless"))){