[FFmpeg-devel] [PATCH] vsink_buffer: don't abort in case of missing frame

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Jun 27 23:49:22 CEST 2011


Do not return AVERROR(EINVAL) in
av_vsink_buffer_get_video_buffer_ref() if no frame is immediately
returned, but keep requesting frames.

This is required for filters which cache frames, e.g. the tinterlace
filter, for which a frame is not immediately returned at the first
avfilter_request_frame() call.
---
 libavfilter/vsink_buffer.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vsink_buffer.c b/libavfilter/vsink_buffer.c
index f8140b5..ca78771 100644
--- a/libavfilter/vsink_buffer.c
+++ b/libavfilter/vsink_buffer.c
@@ -79,14 +79,11 @@ int av_vsink_buffer_get_video_buffer_ref(AVFilterContext *ctx,
     *picref = NULL;
 
     /* no picref available, fetch it from the filterchain */
-    if (!buf->picref) {
+    while (!buf->picref) {
         if ((ret = avfilter_request_frame(inlink)) < 0)
             return ret;
     }
 
-    if (!buf->picref)
-        return AVERROR(EINVAL);
-
     *picref = buf->picref;
     if (!(flags & AV_VSINK_BUF_FLAG_PEEK))
         buf->picref = NULL;
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list