lavc/ccaption_dec: implement "erase non displayed memory"

This commit is contained in:
Aman Gupta 2016-01-05 14:54:54 -08:00 committed by Clément Bœsch
parent 53ee84f811
commit 26abdd61a3
1 changed files with 8 additions and 7 deletions

View File

@ -361,12 +361,9 @@ static void handle_pac(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo)
} }
} }
/** static void handle_erase(CCaptionSubContext *ctx, int64_t pts, int n_screen)
* @param pts it is required to set end time
*/
static void handle_edm(CCaptionSubContext *ctx, int64_t pts)
{ {
struct Screen *screen = ctx->screen + ctx->active_screen; struct Screen *screen = ctx->screen + n_screen;
reap_screen(ctx, pts); reap_screen(ctx, pts);
screen->row_used = 0; screen->row_used = 0;
@ -374,7 +371,7 @@ static void handle_edm(CCaptionSubContext *ctx, int64_t pts)
static void handle_eoc(CCaptionSubContext *ctx, int64_t pts) static void handle_eoc(CCaptionSubContext *ctx, int64_t pts)
{ {
handle_edm(ctx,pts); handle_erase(ctx, pts, ctx->active_screen);
ctx->active_screen = !ctx->active_screen; ctx->active_screen = !ctx->active_screen;
ctx->cursor_column = 0; ctx->cursor_column = 0;
} }
@ -455,7 +452,7 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint
break; break;
case 0x2c: case 0x2c:
/* erase display memory */ /* erase display memory */
handle_edm(ctx, pts); handle_erase(ctx, pts, ctx->active_screen);
break; break;
case 0x2d: case 0x2d:
/* carriage return */ /* carriage return */
@ -464,6 +461,10 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint
roll_up(ctx); roll_up(ctx);
ctx->cursor_column = 0; ctx->cursor_column = 0;
break; break;
case 0x2e:
/* erase non displayed memory */
handle_erase(ctx, pts, !ctx->active_screen);
break;
case 0x2f: case 0x2f:
/* end of caption */ /* end of caption */
ff_dlog(ctx, "handle_eoc\n"); ff_dlog(ctx, "handle_eoc\n");