[FFmpeg-devel] [PATCH] Make vsrc_movie flush decoder frames on EOF.

Stefano Sabatini stefasab at gmail.com
Sun Jul 8 01:41:01 CEST 2012


On date Friday 2012-07-06 22:48:09 -0700, Steven Robertson encoded:
> Eep, sorry, that change broke looping when using ffh264 to decode.
> This new patch adds an explicit flushing state, which prevents looping
> and flushing from interfering with each other, although it does end up
> touching more of the file.
> 
> On Fri, Jul 6, 2012 at 9:41 PM, Steven Robertson <steven at strobe.cc> wrote:
> > Hi all,
> >
> > I found a small bug in vsrc_movie, causing it to cut off early for
> > some inputs. Patch attached. From the commit message:
> >
> > vsrc_movie currently forwards EOF (or begins looping) immediately upon
> > reaching the last packet in the input stream, which can leave frames
> > in the decoder.  This change first tries to read any remaining packets
> > from
> > the decoder before forwarding EOF.
> >
> > Thanks!
> > Steve

> From d2cad628cb67f4fb3512ee70fddf5f417f891521 Mon Sep 17 00:00:00 2001
> From: Steven Robertson <steven at strobe.cc>
> Date: Fri, 6 Jul 2012 22:41:28 -0700
> Subject: [PATCH 1/2] Make vsrc_movie flush decoder frames on EOF.
> 
> vsrc_movie currently forwards EOF (or begins looping) immediately upon
> reaching the last packet in the input stream, which can leave frames in
> the decoder.  This change first tries to read any remaining packets from
> the decoder before forwarding EOF.
> 
> Signed-off-by: Steven Robertson <steven at strobe.cc>
> ---
>  libavfilter/src_movie.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
> index b0c9b08..95ea2fc 100644
> --- a/libavfilter/src_movie.c
> +++ b/libavfilter/src_movie.c
> @@ -42,6 +42,12 @@
>  #include "internal.h"
>  #include "video.h"
>  
> +typedef enum {
> +    STATE_DECODING,
> +    STATE_FLUSHING,

> +    STATE_DONE,

While at it we could choose a less foobar name (I suggest DONE -> ENDING).

[...]

Looks good otherwise, I'll apply soon if I see no more comments.
-- 
FFmpeg = Fast and Fancy Minimalistic Problematic Evanescent Game


More information about the ffmpeg-devel mailing list