From 65a31a0de73c3d8f9533f367b33e64ea257479c1 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Sat, 1 Sep 2012 15:21:01 +1000 Subject: ansi: erase screen on first frame Signed-off-by: Michael Niedermayer --- libavcodec/ansi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/ansi.c') diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 6afd17c3dd..35725005e7 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -58,6 +58,7 @@ typedef struct { int attributes; /**< attribute flags */ int fg; /**< foreground color */ int bg; /**< background color */ + int first_frame; /* ansi parser state machine */ enum { @@ -353,6 +354,10 @@ static int decode_frame(AVCodecContext *avctx, s->frame.pict_type = AV_PICTURE_TYPE_I; s->frame.palette_has_changed = 1; set_palette((uint32_t *)s->frame.data[1]); + if (!s->first_frame) { + erase_screen(avctx); + s->first_frame = 1; + } while(buf < buf_end) { switch(s->state) { -- cgit v1.2.3