lavfi/pan: add supported sample rates to avoid a crash.
authorClément Bœsch <ubitux@gmail.com>
Thu, 17 May 2012 14:31:52 +0000 (16:31 +0200)
committerClément Bœsch <ubitux@gmail.com>
Thu, 17 May 2012 14:31:54 +0000 (16:31 +0200)
libavfilter/af_pan.c

index 49f8677..d8c4116 100644 (file)
@@ -213,12 +213,18 @@ static int query_formats(AVFilterContext *ctx)
     PanContext *pan = ctx->priv;
     AVFilterLink *inlink  = ctx->inputs[0];
     AVFilterLink *outlink = ctx->outputs[0];
+    AVFilterFormats *formats = NULL;
     AVFilterChannelLayouts *layouts;
 
     pan->pure_gains = are_gains_pure(pan);
     /* libswr supports any sample and packing formats */
     avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
 
+    formats = ff_all_samplerates();
+    if (!formats)
+        return AVERROR(ENOMEM);
+    ff_set_common_samplerates(ctx, formats);
+
     // inlink supports any channel layout
     layouts = ff_all_channel_layouts();
     ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);