mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-31 20:02:42 +00:00
buffersrc: avoid creating unnecessary buffer reference
This commit is contained in:
parent
02ac7311c8
commit
785fa50f0b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user