Commit e521a32a authored by Aman Gupta's avatar Aman Gupta Committed by Clément Bœsch

lavc/ccaption_dec: clear buffer before populating with screen contents

parent 7def844b
...@@ -280,6 +280,7 @@ static int reap_screen(CCaptionSubContext *ctx, int64_t pts) ...@@ -280,6 +280,7 @@ static int reap_screen(CCaptionSubContext *ctx, int64_t pts)
int ret = 0; int ret = 0;
struct Screen *screen = ctx->screen + ctx->active_screen; struct Screen *screen = ctx->screen + ctx->active_screen;
ctx->start_time = ctx->startv_time; ctx->start_time = ctx->startv_time;
av_bprint_clear(&ctx->buffer);
for (i = 0; screen->row_used && i < SCREEN_ROWS; i++) for (i = 0; screen->row_used && i < SCREEN_ROWS; i++)
{ {
...@@ -521,7 +522,6 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp ...@@ -521,7 +522,6 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
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->buffer_changed = 0; ctx->buffer_changed = 0;
av_bprint_clear(&ctx->buffer);
} }
} }
......
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