From 1bca73cf1850f2ca3c438ad3a4cec548f3d4f72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 17 May 2012 16:28:19 +0200 Subject: [PATCH 1/2] ffmpeg: do not warn when expecting EOF from lavfi. --- ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 75e0287bf5..92c7444779 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1964,7 +1964,7 @@ static int poll_filters(void) AV_BUFFERSINK_FLAG_NO_REQUEST); #endif if (ret < 0) { - if (ret != AVERROR(EAGAIN)) { + if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { char buf[256]; av_strerror(ret, buf, sizeof(buf)); av_log(NULL, AV_LOG_WARNING, From 5dbd66395acc4ea85a3dd311f93f988a1c6021e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 17 May 2012 16:31:52 +0200 Subject: [PATCH 2/2] lavfi/pan: add supported sample rates to avoid a crash. --- libavfilter/af_pan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 49f8677b90..d8c4116a07 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);