Commit 785fa50f authored by Anton Khirnov's avatar Anton Khirnov

buffersrc: avoid creating unnecessary buffer reference

parent 02ac7311
......@@ -323,21 +323,19 @@ static int request_frame(AVFilterLink *link)
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
if ((ret = ff_start_frame(link, avfilter_ref_buffer(buf, ~0))) < 0 ||
if ((ret = ff_start_frame(link, buf)) < 0 ||
(ret = ff_draw_slice(link, 0, link->h, 1)) < 0 ||
(ret = ff_end_frame(link)) < 0)
goto fail;
return ret;
break;
case AVMEDIA_TYPE_AUDIO:
ret = ff_filter_samples(link, avfilter_ref_buffer(buf, ~0));
ret = ff_filter_samples(link, buf);
break;
default:
avfilter_unref_bufferp(&buf);
return AVERROR(EINVAL);
}
fail:
avfilter_unref_buffer(buf);
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment