From 7e2561fa8313982aa21f7657953eedeeb33b210d Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Mon, 31 Oct 2016 22:14:10 +0000 Subject: lavfi: Use ff_get_video_buffer in all filters using hwframes --- libavfilter/vf_hwupload.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'libavfilter/vf_hwupload.c') diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c index c438d5aac9..8c43e0080d 100644 --- a/libavfilter/vf_hwupload.c +++ b/libavfilter/vf_hwupload.c @@ -161,15 +161,10 @@ static int hwupload_filter_frame(AVFilterLink *link, AVFrame *input) if (input->format == outlink->format) return ff_filter_frame(outlink, input); - output = av_frame_alloc(); + output = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!output) { - err = AVERROR(ENOMEM); - goto fail; - } - - err = av_hwframe_get_buffer(ctx->hwframes_ref, output, 0); - if (err < 0) { av_log(ctx, AV_LOG_ERROR, "Failed to allocate frame to upload to.\n"); + err = AVERROR(ENOMEM); goto fail; } -- cgit v1.2.3