# HG changeset patch # User reimar # Date 1168171608 0 # Node ID 326ddc4f8366f7d92fa408afaed5029459796702 # Parent 58201b080be97ca366a28d361bb92e782b0e925b Document sub_add_text and sub_clear_text diff -r 58201b080be9 -r 326ddc4f8366 subreader.c --- a/subreader.c Sun Jan 07 11:52:46 2007 +0000 +++ b/subreader.c Sun Jan 07 12:06:48 2007 +0000 @@ -2255,6 +2255,17 @@ } #define MAX_SUBLINE 512 +/** + * \brief parse text and append it to subtitle in sub + * \param sub subtitle struct to add text to + * \param txt text to parse + * \param len length of text in txt + * \param endpts pts at which this subtitle text should be removed again + * + * <> and {} are interpreted as comment delimiters, "\n", "\N", '\n', '\r' + * and '\0' are interpreted as newlines, duplicate, leading and trailing + * newlines are ignored. + */ void sub_add_text(subtitle *sub, const char *txt, int len, double endpts) { int comment = 0; int double_newline = 1; // ignore newlines at the beginning @@ -2307,6 +2318,13 @@ } #define MP_NOPTS_VALUE (-1LL<<63) +/** + * \brief remove outdated subtitle lines. + * \param sub subtitle struct to modify + * \param pts current pts. All lines with endpts <= this will be removed. + * Use MP_NOPTS_VALUE to remove all lines + * \return 1 if sub was modified, 0 otherwise. + */ int sub_clear_text(subtitle *sub, double pts) { int i = 0; int changed = 0;