[FFmpeg-cvslog] avcodec/ccaption_dec: correcting line breaks in cc

Anshul Maheshwari git at videolan.org
Sun May 3 23:39:15 CEST 2015


ffmpeg | branch: master | Anshul Maheshwari <er.anshul.maheshwari at gmail.com> | Sun May  3 18:55:40 2015 +0530| [a6b630e9b6d873d97c91322608ce4ac5fb9bed78] | committer: Michael Niedermayer

avcodec/ccaption_dec: correcting line breaks in cc

Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari at gmail.com>
Reviewed-by: Clément Bœsch <u at pkh.me>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/ccaption_dec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index da43ca6..264d21c 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -338,6 +338,10 @@ static int reap_screen(CCaptionSubContext *ctx, int64_t pts)
         }
 
     }
+    if(screen->row_used && ctx->buffer.len >= 2 ) {
+        ctx->buffer.len -= 2;
+        ctx->buffer.str[ctx->buffer.len] = 0;
+    }
     ctx->startv_time = pts;
     ctx->end_time = pts;
     return ret;
@@ -550,7 +554,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
             int start_time = av_rescale_q(ctx->start_time, avctx->time_base, (AVRational){ 1, 100 });
             int end_time = av_rescale_q(ctx->end_time, avctx->time_base, (AVRational){ 1, 100 });
             av_dlog(ctx, "cdp writing data (%s)\n",ctx->buffer.str);
-            ret = ff_ass_add_rect(sub, ctx->buffer.str, start_time, end_time - start_time , 0);
+            ret = ff_ass_add_rect_bprint(sub, &ctx->buffer, start_time, end_time - start_time);
             if (ret < 0)
                 return ret;
             sub->pts = av_rescale_q(ctx->start_time, avctx->time_base, AV_TIME_BASE_Q);



More information about the ffmpeg-cvslog mailing list