diff options
author | Nicolas George <george@nsup.org> | 2015-08-26 00:15:22 +0200 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2015-09-20 18:50:00 +0200 |
commit | 807d4b635567e51108ea3a6a774336321c3250e5 (patch) | |
tree | 7f6192a02bd316a8724f70922dfa4532601fd0e6 /libavfilter | |
parent | 4bb6cb4c7db41e04057a15d7629d0ce1c4556d85 (diff) | |
download | ffmpeg-807d4b635567e51108ea3a6a774336321c3250e5.tar.gz |
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.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/buffersink.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index e693161554..3206bd9dfe 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -133,7 +133,7 @@ int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFr AVFrame *cur_frame; /* no picref available, fetch it from the filterchain */ - if (!av_fifo_size(buf->fifo)) { + while (!av_fifo_size(buf->fifo)) { if (inlink->closed) return AVERROR_EOF; 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; } - if (!av_fifo_size(buf->fifo)) - return AVERROR(EINVAL); - if (flags & AV_BUFFERSINK_FLAG_PEEK) { cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0)); if ((ret = av_frame_ref(frame, cur_frame)) < 0) |