[FFmpeg-cvslog] lavfi/pan: add supported sample rates to avoid a crash.

Clément Bœsch git at videolan.org
Thu May 17 16:56:18 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu May 17 16:31:52 2012 +0200| [5dbd66395acc4ea85a3dd311f93f988a1c6021e8] | committer: Clément Bœsch

lavfi/pan: add supported sample rates to avoid a crash.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dbd66395acc4ea85a3dd311f93f988a1c6021e8
---

 libavfilter/af_pan.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 49f8677..d8c4116 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -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);



More information about the ffmpeg-cvslog mailing list