Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-19 15:24:19 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-19 16:36:54 +0300
commitbc3f19641ce37d14f9cfd7e2693c4833b63fba7d (patch)
treed24e3d3a5823b99a225b58a19807448c9732b352 /ffmpeg_opt.c
parent8271a84094aafe142faa2305890413ddddea1110 (diff)
parent6d592fbd0d8e89ecade3fc93b36ea200213dc01c (diff)
Merge commit '6d592fbd0d8e89ecade3fc93b36ea200213dc01c'
* commit '6d592fbd0d8e89ecade3fc93b36ea200213dc01c': avconv: split creating and (re-)configuring complex filtergraphs Conflicts: ffmpeg_filter.c ffmpeg_opt.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 0398d58ebc..ceebcfea5b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1782,8 +1782,7 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
{
OutputStream *ost;
- switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
- ofilter->out_tmp->pad_idx)) {
+ switch (ofilter->type) {
case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
default:
@@ -1816,13 +1815,21 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
exit_program(1);
}
- if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error configuring filter.\n");
- exit_program(1);
- }
avfilter_inout_free(&ofilter->out_tmp);
}
+static int init_complex_filters(void)
+{
+ int i, ret = 0;
+
+ for (i = 0; i < nb_filtergraphs; i++) {
+ ret = init_complex_filtergraph(filtergraphs[i]);
+ if (ret < 0)
+ return ret;
+ }
+ return 0;
+}
+
static int configure_complex_filters(void)
{
int i, ret = 0;
@@ -1899,8 +1906,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
if (!ofilter->out_tmp || ofilter->out_tmp->name)
continue;
- switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
- ofilter->out_tmp->pad_idx)) {
+ switch (ofilter->type) {
case AVMEDIA_TYPE_VIDEO: o->video_disable = 1; break;
case AVMEDIA_TYPE_AUDIO: o->audio_disable = 1; break;
case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break;
@@ -2919,9 +2925,9 @@ int ffmpeg_parse_options(int argc, char **argv)
}
/* create the complex filtergraphs */
- ret = configure_complex_filters();
+ ret = init_complex_filters();
if (ret < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error configuring filters.\n");
+ av_log(NULL, AV_LOG_FATAL, "Error initializing complex filters.\n");
goto fail;
}
@@ -2932,6 +2938,13 @@ int ffmpeg_parse_options(int argc, char **argv)
goto fail;
}
+ /* configure the complex filtergraphs */
+ ret = configure_complex_filters();
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error configuring complex filters.\n");
+ goto fail;
+ }
+
fail:
uninit_parse_context(&octx);
if (ret < 0) {