mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
dc2e051c4f
2
ffmpeg.c
2
ffmpeg.c
@ -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)
|
|||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user