[FFmpeg-devel] [PATCH 4/4] ffmpeg: probe buffersinks once more after EOF.

Stefano Sabatini stefasab at gmail.com
Tue Jul 17 23:56:43 CEST 2012


On date Tuesday 2012-07-17 18:13:19 +0200, Nicolas George encoded:
> avfilter_graph_request_oldest() can cause frames to arrive
> to the sinks even when it returns EOF.

I suggest:

Reap buffers stored in the buffer sinks even when
the avfilter_graph_request_oldest() loop only returns EOF.

avfilter_graph_request_oldest() can cause frames to arrive
to the sinks even when it returns EOF.

> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  ffmpeg.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 61840cc..35ff099 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -1930,7 +1930,7 @@ static int poll_filters(void)
>      AVFilterBufferRef *picref;
>      AVFrame *filtered_frame = NULL;
>      int i, ret, ret_all;
> -    unsigned nb_success, nb_eof;
> +    unsigned nb_success = 1, av_uninit(nb_eof);
                                ^^^^^^^^^^^^^^^^^
How is this related?

>      int64_t frame_pts;
>  
>      while (1) {
> @@ -2003,6 +2003,8 @@ static int poll_filters(void)
>                  avfilter_unref_buffer(picref);
>              }
>          }
> +        if (!nb_success) /* from last round */
> +            break;
>          /* Request frames through all the graphs */
>          ret_all = nb_success = nb_eof = 0;
>          for (i = 0; i < nb_filtergraphs; i++) {
> @@ -2019,8 +2021,6 @@ static int poll_filters(void)
>                  ret_all = ret;
>              }
>          }
> -        if (!nb_success)
> -            break;

Looks good otherwise.
-- 
FFmpeg = Funny Foolish Minimal Powered Extroverse Gigant


More information about the ffmpeg-devel mailing list