[FFmpeg-cvslog] avcodec/ass: add ff_ass_add_rect_bprint() helper

Clément Bœsch git at videolan.org
Sun Sep 21 18:45:55 CEST 2014


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Sep 21 18:36:11 2014 +0200| [d210c0e777c181f3954582703c95e85d885d68c1] | committer: Clément Bœsch

avcodec/ass: add ff_ass_add_rect_bprint() helper

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

 libavcodec/ass.c |    8 ++++++++
 libavcodec/ass.h |    7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index a5b5ae5..ba0593c 100644
--- a/libavcodec/ass.c
+++ b/libavcodec/ass.c
@@ -151,6 +151,14 @@ err:
     return ret;
 }
 
+int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
+                           int ts_start, int duration, int raw)
+{
+    if (!av_bprint_is_complete(buf))
+        return AVERROR(ENOMEM);
+    return ff_ass_add_rect(sub, buf->str, ts_start, duration, raw);
+}
+
 void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size,
                              const char *linebreaks, int keep_ass_markup)
 {
diff --git a/libavcodec/ass.h b/libavcodec/ass.h
index 2df38e6..5ed947a 100644
--- a/libavcodec/ass.h
+++ b/libavcodec/ass.h
@@ -92,6 +92,13 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
                     int ts_start, int duration, int raw);
 
 /**
+ * Same as ff_ass_add_rect_bprint, but taking an AVBPrint buffer instead of a
+ * string.
+ */
+int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
+                           int ts_start, int duration, int raw);
+
+/**
  * Add an ASS dialog line to an AVBPrint buffer.
  *
  * @param buf pointer to an initialized AVBPrint buffer



More information about the ffmpeg-cvslog mailing list