]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfiltergraph.c
vf_scale: support dynamically changing input parameters.
[ffmpeg] / libavfilter / avfiltergraph.c
index 987b024b57b5987bf275c31b3c75dbb683408cfb..9743009eb53a35e91bb933e916df6c9aeaba42b5 100644 (file)
@@ -200,14 +200,12 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link,
 
     if (link->type == AVMEDIA_TYPE_AUDIO &&
          (((link = filt_ctx-> inputs[0]) &&
-           (!ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts) ||
-            !avfilter_merge_formats(link->in_packing,   link->out_packing))) ||
+           !ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts)) ||
          ((link = filt_ctx->outputs[0]) &&
-           (!ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts) ||
-            !avfilter_merge_formats(link->in_packing,   link->out_packing))))
+           !ff_merge_channel_layouts(link->in_channel_layouts, link->out_channel_layouts)))
        ) {
         av_log(NULL, AV_LOG_ERROR,
-               "Impossible to convert between the channel layouts/packing formats supported by the filter "
+               "Impossible to convert between the channel layouts formats supported by the filter "
                "'%s' and the filter '%s'\n", link->src->name, link->dst->name);
         return AVERROR(EINVAL);
     }
@@ -219,7 +217,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
 {
     int i, j, ret;
     char filt_args[128];
-    AVFilterFormats *formats, *packing;
+    AVFilterFormats *formats;
     AVFilterChannelLayouts *chlayouts;
     AVFilterFormats *samplerates;
     int scaler_count = 0, resampler_count = 0;
@@ -254,8 +252,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                     return ret;
             }
             else if (link->type == AVMEDIA_TYPE_AUDIO) {
-                if (!link->in_channel_layouts || !link->out_channel_layouts ||
-                    !link->in_packing   || !link->out_packing)
+                if (!link->in_channel_layouts || !link->out_channel_layouts)
                     return AVERROR(EINVAL);
 
                 /* Merge all three list before checking: that way, in all
@@ -264,10 +261,9 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                 formats   = avfilter_merge_formats(link->in_formats,   link->out_formats);
                 chlayouts   = ff_merge_channel_layouts(link->in_channel_layouts  , link->out_channel_layouts);
                 samplerates = ff_merge_samplerates    (link->in_samplerates, link->out_samplerates);
-                packing   = avfilter_merge_formats(link->in_packing,   link->out_packing);
 
-                if (!formats || !chlayouts || !packing || !samplerates)
-                    if (ret = insert_conv_filter(graph, link, "aconvert", NULL))
+                if (!formats || !chlayouts || !samplerates)
+                    if (ret = insert_conv_filter(graph, link, "aresample", NULL))
                        return ret;
 #else
             int convert_needed = 0;