[FFmpeg-devel] [PATCH] vsink_buffer: do not request frames if there is nothing to pull

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Jul 9 15:29:37 CEST 2011


On date Friday 2011-07-08 11:00:42 +0200, Stefano Sabatini encoded:
> Perform avfilter_poll_frame() to ensure that there are available
> frames before requesting them. Avoid fastidious warning.
> ---
>  libavfilter/vsink_buffer.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavfilter/vsink_buffer.c b/libavfilter/vsink_buffer.c
> index f8140b5..047815f 100644
> --- a/libavfilter/vsink_buffer.c
> +++ b/libavfilter/vsink_buffer.c
> @@ -79,7 +79,7 @@ int av_vsink_buffer_get_video_buffer_ref(AVFilterContext *ctx,
>      *picref = NULL;
>  
>      /* no picref available, fetch it from the filterchain */
> -    if (!buf->picref) {
> +    if (!buf->picref && avfilter_poll_frame(inlink)) {
>          if ((ret = avfilter_request_frame(inlink)) < 0)
>              return ret;

Dropped, as it is adding overhead which can be avoided by calling
_poll() (and only if needed) in the calling code.
-- 
FFmpeg = Fundamentalist and Foolish MultiPurpose EntanGlement


More information about the ffmpeg-devel mailing list