avfilter/af_dcshift: add direct path

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/269/head
Paul B Mahol 7 years ago
parent d8bc198d09
commit eea69a9f25
  1. 16
      libavfilter/af_dcshift.c

@ -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[] = {

Loading…
Cancel
Save