Commit dc2e051c authored by Michael Niedermayer's avatar Michael Niedermayer

Merge branch 'audio-filters' of https://github.com/ubitux/FFmpeg

* 'audio-filters' of https://github.com/ubitux/FFmpeg:
  lavfi/pan: add supported sample rates to avoid a crash.
  ffmpeg: do not warn when expecting EOF from lavfi.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents b13d39bd 5dbd6639
...@@ -1964,7 +1964,7 @@ static int poll_filters(void) ...@@ -1964,7 +1964,7 @@ static int poll_filters(void)
AV_BUFFERSINK_FLAG_NO_REQUEST); AV_BUFFERSINK_FLAG_NO_REQUEST);
#endif #endif
if (ret < 0) { if (ret < 0) {
if (ret != AVERROR(EAGAIN)) { if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
char buf[256]; char buf[256];
av_strerror(ret, buf, sizeof(buf)); av_strerror(ret, buf, sizeof(buf));
av_log(NULL, AV_LOG_WARNING, av_log(NULL, AV_LOG_WARNING,
......
...@@ -213,12 +213,18 @@ static int query_formats(AVFilterContext *ctx) ...@@ -213,12 +213,18 @@ static int query_formats(AVFilterContext *ctx)
PanContext *pan = ctx->priv; PanContext *pan = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0]; AVFilterLink *outlink = ctx->outputs[0];
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts; AVFilterChannelLayouts *layouts;
pan->pure_gains = are_gains_pure(pan); pan->pure_gains = are_gains_pure(pan);
/* libswr supports any sample and packing formats */ /* libswr supports any sample and packing formats */
avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO)); 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 // inlink supports any channel layout
layouts = ff_all_channel_layouts(); layouts = ff_all_channel_layouts();
ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts); ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment