changeset 21939:2992c0eda0ec

In .srt, any line containing only spaces and tabs marks the end of the current subtitle.
author eugeni
date Thu, 18 Jan 2007 14:50:32 +0000
parents 65cff1c914cb
children c3b8af022289
files subreader.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Thu Jan 18 09:03:42 2007 +0000
+++ b/subreader.c	Thu Jan 18 14:50:32 2007 +0000
@@ -355,10 +355,13 @@
 	current->start = a1*360000+a2*6000+a3*100+a4/10;
 	current->end   = b1*360000+b2*6000+b3*100+b4/10;
 	for (i=0; i<SUB_MAX_TEXT;) {
+	    int blank = 1;
 	    if (!stream_read_line (st, line, LINE_LEN)) break;
 	    len=0;
-	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++);
-	    if (len) {
+	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++)
+		if (*p != ' ' && *p != '\t')
+		    blank = 0;
+	    if (len && !blank) {
                 int j=0,skip=0;
 		char *curptr=current->text[i]=malloc (len+1);
 		if (!current->text[i]) return ERR;