avfilter: pass outlink to ff_get_audio_buffer()

This is more correct.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2018-01-03 22:47:40 +01:00
parent 677701c6b3
commit 88cbd25b19
27 changed files with 29 additions and 29 deletions

View File

@ -173,7 +173,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -192,7 +192,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (ctx->is_disabled || !s->delays)
return ff_filter_frame(ctx->outputs[0], frame);
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -279,7 +279,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -96,7 +96,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -282,7 +282,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
if (av_frame_is_writable(buf)) {
out_buf = buf;
} else {
out_buf = ff_get_audio_buffer(inlink, nb_samples);
out_buf = ff_get_audio_buffer(outlink, nb_samples);
if (!out_buf)
return AVERROR(ENOMEM);
av_frame_copy_props(out_buf, buf);

View File

@ -214,7 +214,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -135,7 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -247,7 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
if (av_frame_is_writable(inbuf)) {
outbuf = inbuf;
} else {
outbuf = ff_get_audio_buffer(inlink, inbuf->nb_samples);
outbuf = ff_get_audio_buffer(outlink, inbuf->nb_samples);
if (!outbuf) {
av_frame_free(&inbuf);
return AVERROR(ENOMEM);

View File

@ -417,7 +417,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
if (av_frame_is_writable(buf)) {
out_buf = buf;
} else {
out_buf = ff_get_audio_buffer(inlink, nb_samples);
out_buf = ff_get_audio_buffer(outlink, nb_samples);
if (!out_buf) {
av_frame_free(&buf);
return AVERROR(ENOMEM);

View File

@ -135,7 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
out_frame = ff_get_audio_buffer(outlink, frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -247,7 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -185,7 +185,7 @@ static int compand_nodelay(AVFilterContext *ctx, AVFrame *frame)
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, nb_samples);
out_frame = ff_get_audio_buffer(ctx->outputs[0], nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
@ -249,7 +249,7 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
if (count >= s->delay_samples) {
if (!out_frame) {
out_frame = ff_get_audio_buffer(inlink, nb_samples - i);
out_frame = ff_get_audio_buffer(ctx->outputs[0], nb_samples - i);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -131,7 +131,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out;
int n, ch;
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(ctx->outputs[0], in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -99,7 +99,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -115,7 +115,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
{
AVFilterLink *outlink = inlink->dst->outputs[0];
int16_t *taps, *endin, *in, *out;
AVFrame *outsamples = ff_get_audio_buffer(inlink, insamples->nb_samples);
AVFrame *outsamples = ff_get_audio_buffer(outlink, insamples->nb_samples);
int len;
if (!outsamples) {

View File

@ -71,7 +71,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -148,7 +148,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) {
out_frame = frame;
} else {
out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);

View File

@ -144,7 +144,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -423,7 +423,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -554,7 +554,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
uint32_t level;
AVFrame *out;
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -128,7 +128,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
nb_samples = rubberband_available(s->rbs);
if (nb_samples > 0) {
out = ff_get_audio_buffer(inlink, nb_samples);
out = ff_get_audio_buffer(outlink, nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);
@ -187,7 +187,7 @@ static int request_frame(AVFilterLink *outlink)
nb_samples = rubberband_available(s->rbs);
if (nb_samples > 0) {
out = ff_get_audio_buffer(inlink, nb_samples);
out = ff_get_audio_buffer(outlink, nb_samples);
if (!out)
return AVERROR(ENOMEM);
out->pts = av_rescale_q(s->nb_samples_out,

View File

@ -367,7 +367,7 @@ static int acompressor_filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -166,7 +166,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -98,7 +98,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -57,7 +57,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -63,7 +63,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (av_frame_is_writable(in)) {
out = in;
} else {
out = ff_get_audio_buffer(inlink, in->nb_samples);
out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);

View File

@ -410,7 +410,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
&& (vol->precision != PRECISION_FIXED || vol->volume_i > 0)) {
out_buf = buf;
} else {
out_buf = ff_get_audio_buffer(inlink, nb_samples);
out_buf = ff_get_audio_buffer(outlink, nb_samples);
if (!out_buf) {
av_frame_free(&buf);
return AVERROR(ENOMEM);