[MPlayer-cvslog] r37599 - in branches/1.2: . sub/subassconvert.c

rtogni subversion at mplayerhq.hu
Tue Jan 19 23:02:21 CET 2016


Author: rtogni
Date: Tue Jan 19 23:02:20 2016
New Revision: 37599

Log:
Merge r37598 from trunk

Fix attribute parsing at SRT subtitles

Modified:
   branches/1.2/   (props changed)
   branches/1.2/sub/subassconvert.c

Modified: branches/1.2/sub/subassconvert.c
==============================================================================
--- branches/1.2/sub/subassconvert.c	Mon Jan 18 22:44:40 2016	(r37598)
+++ branches/1.2/sub/subassconvert.c	Tue Jan 19 23:02:20 2016	(r37599)
@@ -195,19 +195,19 @@ void subassconvert_subrip(const char *or
             int has_valid_attr = 0;
 
             *tag = tag[-1]; // keep values from previous tag
-            line += 6;
+            line += 5;      // don't skip space!
 
             while (*line && *line != '>') {
-                if (strncmp(line, "size=", 5) == 0) {
-                    line += 5;
+                if (strncmp(line, " size=", 6) == 0) {
+                    line += 6;
                     if (*line == '"') line++;
                     tag->size = strtol(line, &line, 10);
                     if (!tag->size)
                         break;
                     append_text(&new_line, "{\\fs%d}", tag->size);
                     has_valid_attr = 1;
-                } else if (strncmp(line, "color=", 6) == 0) {
-                    line += 6;
+                } else if (strncmp(line, " color=", 7) == 0) {
+                    line += 7;
                     if (*line == '"') line++;
                     if (*line == '#') {
                         // #RRGGBB format
@@ -241,10 +241,10 @@ void subassconvert_subrip(const char *or
                     }
                     append_text(&new_line, "{\\c&H%06X&}", tag->color & 0xffffff);
                     has_valid_attr = 1;
-                } else if (strncmp(line, "face=\"", 6) == 0) {
+                } else if (strncmp(line, " face=\"", 7) == 0) {
                     /* Font face attribute */
                     int len;
-                    line += 6;
+                    line += 7;
                     len = indexof(line, '"');
                     if (len <= 0)
                         break;


More information about the MPlayer-cvslog mailing list