Commit 65a31a0d authored by Peter Ross's avatar Peter Ross Committed by Michael Niedermayer

ansi: erase screen on first frame

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3ac718d6
......@@ -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) {
......
#tb 0: 1/25
0, 0, 0, 1, 768000, 0xc4865718
0, 1, 1, 1, 768000, 0x2c7de258
0, 2, 2, 1, 768000, 0x0d6b8dc6
0, 0, 0, 1, 768000, 0x772dd3d0
0, 1, 1, 1, 768000, 0xd7dab1d1
0, 2, 2, 1, 768000, 0x0e56f2d3
0, 3, 3, 1, 768000, 0x11c1fb8e
0, 4, 4, 1, 768000, 0x72d12da9
0, 5, 5, 1, 768000, 0x39c7a70d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment