aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2007-10-15 07:20:54 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-10-15 07:20:54 +0000
commit9a3fb64000d0ce0e7666f1c4942a9aca1eb2bfdf (patch)
treeae2682d5f29a544e6410e7127944061a6abe611d /ffmpeg.c
parent44a7e65a517ecc18d6da6f6529dc909ef4cac3c7 (diff)
downloadffmpeg-9a3fb64000d0ce0e7666f1c4942a9aca1eb2bfdf.tar.gz
Merge audio and video bitstream filter options handling.
Originally committed as revision 10739 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 62d3be73d6..e7fcf87a5e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3530,7 +3530,7 @@ static void opt_vstats (void)
opt_vstats_file(filename);
}
-static void opt_video_bsf(const char *arg)
+static void opt_bsf(const char *opt, const char *arg)
{
AVBitStreamFilterContext *bsfc= av_bitstream_filter_init(arg); //FIXME split name and args for filter at '='
AVBitStreamFilterContext **bsfp;
@@ -3540,25 +3540,7 @@ static void opt_video_bsf(const char *arg)
exit(1);
}
- bsfp= &video_bitstream_filters;
- while(*bsfp)
- bsfp= &(*bsfp)->next;
-
- *bsfp= bsfc;
-}
-
-//FIXME avoid audio - video code duplication
-static void opt_audio_bsf(const char *arg)
-{
- AVBitStreamFilterContext *bsfc= av_bitstream_filter_init(arg); //FIXME split name and args for filter at '='
- AVBitStreamFilterContext **bsfp;
-
- if(!bsfc){
- fprintf(stderr, "Unknown bitstream filter %s\n", arg);
- exit(1);
- }
-
- bsfp= &audio_bitstream_filters;
+ bsfp= *opt == 'v' ? &video_bitstream_filters : &audio_bitstream_filters;
while(*bsfp)
bsfp= &(*bsfp)->next;
@@ -3727,8 +3709,8 @@ const OptionDef options[] = {
{ "muxdelay", OPT_FLOAT | HAS_ARG | OPT_EXPERT, {(void*)&mux_max_delay}, "set the maximum demux-decode delay", "seconds" },
{ "muxpreload", OPT_FLOAT | HAS_ARG | OPT_EXPERT, {(void*)&mux_preload}, "set the initial demux-decode delay", "seconds" },
- { "absf", HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_audio_bsf}, "", "bitstream filter" },
- { "vbsf", HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_video_bsf}, "", "bitstream filter" },
+ { "absf", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream filter" },
+ { "vbsf", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream filter" },
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ NULL, },