On Sat, Sep 19, 2015 at 11:28:15PM -0500, Kyle Swanson wrote:
[...]
> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> +{
> +    AVFilterContext *ctx = inlink->dst;
> +    AVFilterLink *outlink = ctx->outputs[0];
> +    AVFrame *out;
> +
> +    if (av_frame_is_writable(in)) {
> +        out = in;
> +    } else {
> +        out = ff_get_audio_buffer(inlink, in->nb_samples);
> +        if (!out) {
> +            av_frame_free(&in);
> +            return AVERROR(ENOMEM);
> +        }
> +        av_frame_copy_props(out, in);
> +    }
> +
> +    int channels = inlink->channels;
> +    int nb_samples = in->nb_samples;
> +    double *dst = (double *)out->data[0];
> +    int n, c;
> +
> +    for (n = 0; n < nb_samples; n++) {
> +        float env = trem_env(ctx);
> +        for (c = 0; c < channels; c++) {

> +            dst[c] *= env;

Doesn't this code only works in the case of inplace?

You may play with perms filters to check if you get the same results, but
I'm pretty sure it doesn't give you the same results in both paths.

> +        }
> +        dst += channels;
> +    }
> +
> +    if (in != out)
> +        av_frame_free(&in);
> +
> +    return ff_filter_frame(outlink, out);
> +}
[...]

-- 
Clément B.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to