changeset 21833:326ddc4f8366

Document sub_add_text and sub_clear_text
author reimar
date Sun, 07 Jan 2007 12:06:48 +0000
parents 58201b080be9
children 8d486fd6cf2f
files subreader.c
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;