summaryrefslogtreecommitdiff
path: root/avconv_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-27 12:14:33 +0200
committerAnton Khirnov <anton@khirnov.net>2016-06-25 12:04:32 +0200
commita3a0230a9870b9018dc7415ae5872784d524cfe5 (patch)
treee3b25576b71cdae38235c1cd480455329480d027 /avconv_opt.c
parent3e265ca58f0505470186dce300ab66a6eac3978e (diff)
avconv: init filtergraphs only after we have a frame on each input
This makes sure the actual stream parameters are used, which is important mainly for hardware decoding+filtering cases, which would previously require various weird workarounds to handle the fact that a fake software graph has to be constructed, but never used. This should also improve behaviour in rare cases where avformat_find_stream_info() does not provide accurate information.
Diffstat (limited to 'avconv_opt.c')
-rw-r--r--avconv_opt.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index 814500d2bd..362a5b7f5e 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -553,10 +553,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
switch (par->codec_type) {
case AVMEDIA_TYPE_VIDEO:
- ist->resample_height = ist->dec_ctx->height;
- ist->resample_width = ist->dec_ctx->width;
- ist->resample_pix_fmt = ist->dec_ctx->pix_fmt;
-
MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st);
if (framerate && av_parse_video_rate(&ist->framerate,
framerate) < 0) {
@@ -616,12 +612,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
break;
case AVMEDIA_TYPE_AUDIO:
guess_input_channel_layout(ist);
-
- ist->resample_sample_fmt = ist->dec_ctx->sample_fmt;
- ist->resample_sample_rate = ist->dec_ctx->sample_rate;
- ist->resample_channels = ist->dec_ctx->channels;
- ist->resample_channel_layout = ist->dec_ctx->channel_layout;
-
break;
case AVMEDIA_TYPE_DATA:
case AVMEDIA_TYPE_SUBTITLE:
@@ -1497,33 +1487,6 @@ static int init_complex_filters(void)
return 0;
}
-static int configure_complex_filters(void)
-{
- int i, j, ret = 0;
-
- for (i = 0; i < nb_filtergraphs; i++) {
- FilterGraph *fg = filtergraphs[i];
-
- if (filtergraph_is_simple(fg))
- continue;
-
- for (j = 0; j < fg->nb_inputs; j++) {
- ret = ifilter_parameters_from_decoder(fg->inputs[j],
- fg->inputs[j]->ist->dec_ctx);
- if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR,
- "Error initializing filtergraph %d input %d\n", i, j);
- return ret;
- }
- }
-
- ret = configure_filtergraph(filtergraphs[i]);
- if (ret < 0)
- return ret;
- }
- return 0;
-}
-
static int open_output_file(OptionsContext *o, const char *filename)
{
AVFormatContext *oc;
@@ -2471,13 +2434,6 @@ int avconv_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) {