1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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)) { if (av_frame_is_writable(in)) {
out = in; out = in;
} else { } else {
out = ff_get_audio_buffer(inlink, in->nb_samples); out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) { if (!out) {
av_frame_free(&in); av_frame_free(&in);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

@ -279,7 +279,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) { if (av_frame_is_writable(frame)) {
out_frame = frame; out_frame = frame;
} else { } 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) { if (!out_frame) {
av_frame_free(&frame); av_frame_free(&frame);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

@ -282,7 +282,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
if (av_frame_is_writable(buf)) { if (av_frame_is_writable(buf)) {
out_buf = buf; out_buf = buf;
} else { } else {
out_buf = ff_get_audio_buffer(inlink, nb_samples); out_buf = ff_get_audio_buffer(outlink, nb_samples);
if (!out_buf) if (!out_buf)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_frame_copy_props(out_buf, buf); 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)) { if (av_frame_is_writable(in)) {
out = in; out = in;
} else { } else {
out = ff_get_audio_buffer(inlink, in->nb_samples); out = ff_get_audio_buffer(outlink, in->nb_samples);
if (!out) { if (!out) {
av_frame_free(&in); av_frame_free(&in);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

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

View File

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

View File

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

View File

@ -247,7 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) { if (av_frame_is_writable(frame)) {
out_frame = frame; out_frame = frame;
} else { } 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) { if (!out_frame) {
av_frame_free(&frame); av_frame_free(&frame);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

@ -131,7 +131,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out; AVFrame *out;
int n, ch; 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) { if (!out) {
av_frame_free(&in); av_frame_free(&in);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

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

View File

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

View File

@ -148,7 +148,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (av_frame_is_writable(frame)) { if (av_frame_is_writable(frame)) {
out_frame = frame; out_frame = frame;
} else { } 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) { if (!out_frame) {
av_frame_free(&frame); av_frame_free(&frame);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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