Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2016-01-06 01:54:54 +0300
committerClément Bœsch <u@pkh.me>2016-01-08 22:24:49 +0300
commit26abdd61a39735c7907297e9b5c8bfe5255be555 (patch)
tree32c400c2fb07dba0e1c37b98983c09de88f3a444 /libavcodec/ccaption_dec.c
parent53ee84f811c3a3e55c688116d41310e76d285d9e (diff)
lavc/ccaption_dec: implement "erase non displayed memory"
Diffstat (limited to 'libavcodec/ccaption_dec.c')
-rw-r--r--libavcodec/ccaption_dec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index bfdf511bfc..02bce01e2d 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -361,12 +361,9 @@ static void handle_pac(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo)
}
}
-/**
- * @param pts it is required to set end time
- */
-static void handle_edm(CCaptionSubContext *ctx, int64_t pts)
+static void handle_erase(CCaptionSubContext *ctx, int64_t pts, int n_screen)
{
- struct Screen *screen = ctx->screen + ctx->active_screen;
+ struct Screen *screen = ctx->screen + n_screen;
reap_screen(ctx, pts);
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)
{
- handle_edm(ctx,pts);
+ handle_erase(ctx, pts, ctx->active_screen);
ctx->active_screen = !ctx->active_screen;
ctx->cursor_column = 0;
}
@@ -455,7 +452,7 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint
break;
case 0x2c:
/* erase display memory */
- handle_edm(ctx, pts);
+ handle_erase(ctx, pts, ctx->active_screen);
break;
case 0x2d:
/* carriage return */
@@ -464,6 +461,10 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint
roll_up(ctx);
ctx->cursor_column = 0;
break;
+ case 0x2e:
+ /* erase non displayed memory */
+ handle_erase(ctx, pts, !ctx->active_screen);
+ break;
case 0x2f:
/* end of caption */
ff_dlog(ctx, "handle_eoc\n");