summaryrefslogtreecommitdiff
path: root/libavcodec/ansi.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-09-01 15:21:01 +1000
committerMichael Niedermayer <michaelni@gmx.at>2012-09-01 15:23:39 +0200
commit65a31a0de73c3d8f9533f367b33e64ea257479c1 (patch)
treefb2de19f7c9ffeb724e3b98906888bc44f9f8ef8 /libavcodec/ansi.c
parent3ac718d60a97fac51a20843ad4f6a8f773b7117b (diff)
ansi: erase screen on first frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ansi.c')
-rw-r--r--libavcodec/ansi.c5
1 files changed, 5 insertions, 0 deletions
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) {