[FFmpeg-cvslog] lavc/ccaption_dec: clear buffer before populating with screen contents

Aman Gupta git at videolan.org
Sat Jan 9 12:33:36 CET 2016


ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Fri Jan  8 17:54:29 2016 -0800| [e521a32af27384e85911f26e7be30faa866a9992] | committer: Clément Bœsch

lavc/ccaption_dec: clear buffer before populating with screen contents

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e521a32af27384e85911f26e7be30faa866a9992
---

 libavcodec/ccaption_dec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 92c3468..e4c4b83 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -280,6 +280,7 @@ static int reap_screen(CCaptionSubContext *ctx, int64_t pts)
     int ret = 0;
     struct Screen *screen = ctx->screen + ctx->active_screen;
     ctx->start_time = ctx->startv_time;
+    av_bprint_clear(&ctx->buffer);
 
     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
                 return ret;
             sub->pts = av_rescale_q(ctx->start_time, avctx->time_base, AV_TIME_BASE_Q);
             ctx->buffer_changed = 0;
-            av_bprint_clear(&ctx->buffer);
         }
     }
 



More information about the ffmpeg-cvslog mailing list