ffmpeg: replace messy duplicated tag compatibility functions by more generic solution.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
cec92fe49a
commit
7ba8e6bbae
21
ffmpeg.c
21
ffmpeg.c
@ -4284,21 +4284,6 @@ static int opt_passlogfile(const char *opt, const char *arg)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int opt_video_tag(OptionsContext *o, const char *opt, const char *arg)
|
||||
{
|
||||
return parse_option(o, "tag:v", arg, options);
|
||||
}
|
||||
|
||||
static int opt_audio_tag(OptionsContext *o, const char *opt, const char *arg)
|
||||
{
|
||||
return parse_option(o, "tag:a", arg, options);
|
||||
}
|
||||
|
||||
static int opt_subtitle_tag(OptionsContext *o, const char *opt, const char *arg)
|
||||
{
|
||||
return parse_option(o, "tag:s", arg, options);
|
||||
}
|
||||
|
||||
static int opt_old2new(OptionsContext *o, const char *opt, const char *arg){
|
||||
char *s= av_malloc(strlen(opt)+2);
|
||||
snprintf(s, strlen(opt)+2, "%s:%c", opt+1, *opt);
|
||||
@ -4394,7 +4379,7 @@ static const OptionDef options[] = {
|
||||
{ "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" },
|
||||
{ "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" },
|
||||
{ "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" },
|
||||
{ "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_FUNC2, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
|
||||
{ "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_FUNC2, {(void*)opt_old2new}, "force video tag/fourcc", "fourcc/tag" },
|
||||
{ "qphist", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, { (void *)&qp_hist }, "show QP histogram" },
|
||||
{ "force_fps", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&force_fps}, "force the selected framerate, disable the best supported framerate selection" },
|
||||
{ "streamid", HAS_ARG | OPT_EXPERT, {(void*)opt_streamid}, "set the value of an outfile streamid", "streamIndex:value" },
|
||||
@ -4407,14 +4392,14 @@ static const OptionDef options[] = {
|
||||
{ "ac", HAS_ARG | OPT_AUDIO | OPT_INT | OPT_SPEC, {.off = OFFSET(audio_channels)}, "set number of audio channels", "channels" },
|
||||
{ "an", OPT_BOOL | OPT_AUDIO | OPT_OFFSET, {.off = OFFSET(audio_disable)}, "disable audio" },
|
||||
{ "acodec", HAS_ARG | OPT_AUDIO | OPT_FUNC2, {(void*)opt_audio_codec}, "force audio codec ('copy' to copy stream)", "codec" },
|
||||
{ "atag", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_FUNC2, {(void*)opt_audio_tag}, "force audio tag/fourcc", "fourcc/tag" },
|
||||
{ "atag", HAS_ARG | OPT_EXPERT | OPT_AUDIO | OPT_FUNC2, {(void*)opt_old2new}, "force audio tag/fourcc", "fourcc/tag" },
|
||||
{ "vol", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&audio_volume}, "change audio volume (256=normal)" , "volume" }, //
|
||||
{ "sample_fmt", HAS_ARG | OPT_EXPERT | OPT_AUDIO, {(void*)opt_audio_sample_fmt}, "set sample format, 'list' as argument shows all the sample formats supported", "format" },
|
||||
|
||||
/* subtitle options */
|
||||
{ "sn", OPT_BOOL | OPT_SUBTITLE | OPT_OFFSET, {.off = OFFSET(subtitle_disable)}, "disable subtitle" },
|
||||
{ "scodec", HAS_ARG | OPT_SUBTITLE | OPT_FUNC2, {(void*)opt_subtitle_codec}, "force subtitle codec ('copy' to copy stream)", "codec" },
|
||||
{ "stag", HAS_ARG | OPT_EXPERT | OPT_SUBTITLE | OPT_FUNC2, {(void*)opt_subtitle_tag}, "force subtitle tag/fourcc", "fourcc/tag" },
|
||||
{ "stag", HAS_ARG | OPT_EXPERT | OPT_SUBTITLE | OPT_FUNC2, {(void*)opt_old2new}, "force subtitle tag/fourcc", "fourcc/tag" },
|
||||
|
||||
/* grab options */
|
||||
{ "vc", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_channel}, "deprecated, use -channel", "channel" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user