# HG changeset patch # User reimar # Date 1401218531 0 # Node ID 8e89cf177d51d2bdd2cf0fbff524086a23763a2b # Parent a0a13230b8d18ebfa9d73cc174d60417199ca0c8 subreader: Split a monster if() into multiple parts. Should make code more maintainable. Also make sure all input variables are properly reset before each test. diff -r a0a13230b8d1 -r 8e89cf177d51 sub/subreader.c --- a/sub/subreader.c Tue May 27 19:22:10 2014 +0000 +++ b/sub/subreader.c Tue May 27 19:22:11 2014 +0000 @@ -594,28 +594,59 @@ char line[LINE_LEN+1]; int a1,a2,a3,a4,b1,b2,b3,b4; char *p=NULL,*next=NULL; - int len,plen; + int plen; while (!current->text[0]) { + int match = 0; if (!stream_read_line (st, line, LINE_LEN, utf16)) return NULL; //TODO: it seems that format of time is not easily determined, it may be 1:12, 1:12.0 or 0:1:12.0 //to describe the same moment in time. Maybe there are even more formats in use. + //This probably should be changed to do something nicer than + //"brute-forcing" a long list of format strings. //if ((len=sscanf (line, "