| @@ -123,7 +123,7 @@ typedef struct CCaptionSubContext { | |||||
| uint8_t cursor_color; | uint8_t cursor_color; | ||||
| uint8_t cursor_font; | uint8_t cursor_font; | ||||
| AVBPrint buffer; | AVBPrint buffer; | ||||
| int screen_changed; | |||||
| int buffer_changed; | |||||
| int rollup; | int rollup; | ||||
| enum cc_mode mode; | enum cc_mode mode; | ||||
| int64_t start_time; | int64_t start_time; | ||||
| @@ -365,7 +365,7 @@ static void handle_edm(CCaptionSubContext *ctx, int64_t pts) | |||||
| reap_screen(ctx, pts); | reap_screen(ctx, pts); | ||||
| screen->row_used = 0; | screen->row_used = 0; | ||||
| ctx->screen_changed = 1; | |||||
| ctx->buffer_changed = 1; | |||||
| } | } | ||||
| static void handle_eoc(CCaptionSubContext *ctx, int64_t pts) | static void handle_eoc(CCaptionSubContext *ctx, int64_t pts) | ||||
| @@ -458,7 +458,7 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint | |||||
| ff_dlog(ctx, "carriage return\n"); | ff_dlog(ctx, "carriage return\n"); | ||||
| reap_screen(ctx, pts); | reap_screen(ctx, pts); | ||||
| roll_up(ctx); | roll_up(ctx); | ||||
| ctx->screen_changed = 1; | |||||
| ctx->buffer_changed = 1; | |||||
| ctx->cursor_column = 0; | ctx->cursor_column = 0; | ||||
| break; | break; | ||||
| case 0x2f: | case 0x2f: | ||||
| @@ -512,7 +512,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp | |||||
| continue; | continue; | ||||
| else | else | ||||
| process_cc608(ctx, avpkt->pts, *(bptr + i + 1) & 0x7f, *(bptr + i + 2) & 0x7f); | process_cc608(ctx, avpkt->pts, *(bptr + i + 1) & 0x7f, *(bptr + i + 2) & 0x7f); | ||||
| if (ctx->screen_changed && *ctx->buffer.str) | |||||
| if (ctx->buffer_changed && *ctx->buffer.str) | |||||
| { | { | ||||
| int start_time = av_rescale_q(ctx->start_time, avctx->time_base, ass_tb); | int start_time = av_rescale_q(ctx->start_time, avctx->time_base, ass_tb); | ||||
| int end_time = av_rescale_q(ctx->end_time, avctx->time_base, ass_tb); | int end_time = av_rescale_q(ctx->end_time, avctx->time_base, ass_tb); | ||||
| @@ -521,7 +521,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp | |||||
| if (ret < 0) | if (ret < 0) | ||||
| return ret; | return ret; | ||||
| sub->pts = av_rescale_q(ctx->start_time, avctx->time_base, AV_TIME_BASE_Q); | sub->pts = av_rescale_q(ctx->start_time, avctx->time_base, AV_TIME_BASE_Q); | ||||
| ctx->screen_changed = 0; | |||||
| ctx->buffer_changed = 0; | |||||
| av_bprint_clear(&ctx->buffer); | av_bprint_clear(&ctx->buffer); | ||||
| } | } | ||||
| } | } | ||||