X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Faf_stereotools.c;h=3c796f5b15e7ddc97e35b4819acc831db78b164b;hb=b2517b02d99054b18398427ba890fee582a8c7bf;hp=6a3265d63128e215e27c778299ac2be87b4382b3;hpb=9d6873a43d2085e64651ffe9bf343d0dde182e93;p=ffmpeg diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c index 6a3265d6312..3c796f5b15e 100644 --- a/libavfilter/af_stereotools.c +++ b/libavfilter/af_stereotools.c @@ -92,16 +92,15 @@ static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats = NULL; AVFilterChannelLayouts *layout = NULL; + int ret; - ff_add_format(&formats, AV_SAMPLE_FMT_DBL); - ff_set_common_formats(ctx, formats); - ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO); - ff_set_common_channel_layouts(ctx, layout); + if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_DBL )) < 0 || + (ret = ff_set_common_formats (ctx , formats )) < 0 || + (ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_STEREO)) < 0 || + (ret = ff_set_common_channel_layouts (ctx , layout )) < 0) + return ret; formats = ff_all_samplerates(); - if (!formats) - return AVERROR(ENOMEM); - return ff_set_common_samplerates(ctx, formats); } @@ -140,14 +139,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) const double sc_level = s->sc_level; const double delay = s->delay; const int length = s->length; - const int mute_l = floor(s->mute_l + 0.5); - const int mute_r = floor(s->mute_r + 0.5); - const int phase_l = floor(s->phase_l + 0.5); - const int phase_r = floor(s->phase_r + 0.5); + const int mute_l = s->mute_l; + const int mute_r = s->mute_r; + const int phase_l = s->phase_l; + const int phase_r = s->phase_r; double *buffer = s->buffer; AVFrame *out; double *dst; - int nbuf = inlink->sample_rate * (FFABS(delay) / 1000.); + int nbuf = inlink->sample_rate * (fabs(delay) / 1000.); int n; nbuf -= nbuf % 2;