From 44ecf3956720cf8ea9631f7e1d2cb1a351cfe1ec Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 7 Jan 2007 12:06:48 +0000 Subject: Document sub_add_text and sub_clear_text git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21851 b3059339-0415-0410-9bf9-f77b7e298cf2 --- subreader.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'subreader.c') diff --git a/subreader.c b/subreader.c index 932cf1f96f..511356a3a1 100644 --- a/subreader.c +++ b/subreader.c @@ -2255,6 +2255,17 @@ void sub_free( sub_data * subd ) } #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 @@ void sub_add_text(subtitle *sub, const char *txt, int len, double endpts) { } #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; -- cgit v1.2.3