diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-28 08:41:07 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:37:18 +0100 |
commit | 7e350379f87e7f74420b4813170fe808e2313911 (patch) | |
tree | 031201839361d40af8b4c829f9c9f179e7d9f58d /libavfilter/af_amix.c | |
parent | 77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff) | |
download | ffmpeg-7e350379f87e7f74420b4813170fe808e2313911.tar.gz |
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
Diffstat (limited to 'libavfilter/af_amix.c')
-rw-r--r-- | libavfilter/af_amix.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index c2fb158031..5a4ec2e60e 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -275,18 +275,18 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) { AVFilterContext *ctx = outlink->src; MixContext *s = ctx->priv; - AVFilterBufferRef *out_buf, *in_buf; + AVFrame *out_buf, *in_buf; int i; calculate_scales(s, nb_samples); - out_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples); + out_buf = ff_get_audio_buffer(outlink, nb_samples); if (!out_buf) return AVERROR(ENOMEM); - in_buf = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples); + in_buf = ff_get_audio_buffer(outlink, nb_samples); if (!in_buf) { - avfilter_unref_buffer(out_buf); + av_frame_free(&out_buf); return AVERROR(ENOMEM); } @@ -308,7 +308,7 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) } } } - avfilter_unref_buffer(in_buf); + av_frame_free(&in_buf); out_buf->pts = s->next_pts; if (s->next_pts != AV_NOPTS_VALUE) @@ -455,7 +455,7 @@ static int request_frame(AVFilterLink *outlink) return output_frame(outlink, available_samples); } -static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) +static int filter_frame(AVFilterLink *inlink, AVFrame *buf) { AVFilterContext *ctx = inlink->dst; MixContext *s = ctx->priv; @@ -474,16 +474,16 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) if (i == 0) { int64_t pts = av_rescale_q(buf->pts, inlink->time_base, outlink->time_base); - ret = frame_list_add_frame(s->frame_list, buf->audio->nb_samples, pts); + ret = frame_list_add_frame(s->frame_list, buf->nb_samples, pts); if (ret < 0) goto fail; } ret = av_audio_fifo_write(s->fifos[i], (void **)buf->extended_data, - buf->audio->nb_samples); + buf->nb_samples); fail: - avfilter_unref_buffer(buf); + av_frame_free(&buf); return ret; } |