You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavfi/buffersink: loop over ff_request_frame().
Do not assume that ff_request_frame() returning success implies a frame has arrived in the FIFO. Instead, just loop until a frame is in the FIFO. It does not change anything since the same loop is present in ff_request_frame(), confirmed by an assertion.
This commit is contained in:
@@ -133,7 +133,7 @@ int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFr
|
|||||||
AVFrame *cur_frame;
|
AVFrame *cur_frame;
|
||||||
|
|
||||||
/* no picref available, fetch it from the filterchain */
|
/* no picref available, fetch it from the filterchain */
|
||||||
if (!av_fifo_size(buf->fifo)) {
|
while (!av_fifo_size(buf->fifo)) {
|
||||||
if (inlink->closed)
|
if (inlink->closed)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)
|
if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST)
|
||||||
@@ -142,9 +142,6 @@ int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFr
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!av_fifo_size(buf->fifo))
|
|
||||||
return AVERROR(EINVAL);
|
|
||||||
|
|
||||||
if (flags & AV_BUFFERSINK_FLAG_PEEK) {
|
if (flags & AV_BUFFERSINK_FLAG_PEEK) {
|
||||||
cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0));
|
cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0));
|
||||||
if ((ret = av_frame_ref(frame, cur_frame)) < 0)
|
if ((ret = av_frame_ref(frame, cur_frame)) < 0)
|
||||||
|
Reference in New Issue
Block a user