Browse Source

avfilter/af_dcshift: add direct path

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.4
Paul B Mahol 7 years ago
parent
commit
eea69a9f25
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      libavfilter/af_dcshift.c

+ 11
- 5
libavfilter/af_dcshift.c View File

@@ -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