Commit eea69a9f authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_dcshift: add direct path

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent d8bc198d
......@@ -90,11 +90,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int i, j;
double dcshift = s->dcshift;
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);
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);
}
av_frame_copy_props(out, in);
if (s->limitergain > 0) {
for (i = 0; i < inlink->channels; i++) {
......@@ -134,7 +139,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
}
av_frame_free(&in);
if (out != in)
av_frame_free(&in);
return ff_filter_frame(outlink, out);
}
static const AVFilterPad dcshift_inputs[] = {
......
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