Index: libass/ass_utils.c =================================================================== --- libass/ass_utils.c (wersja 29328) +++ libass/ass_utils.c (kopia robocza) @@ -72,12 +72,17 @@ uint32_t color = 0; int result; char* p = *q; + + while(*p <= 0x20) { + mp_msg(MSGT_ASS, MSGL_DBG2, "suspicious color format: \"%s\"\n", p); + ++p; + } if (*p == '&') ++p; - else mp_msg(MSGT_ASS, MSGL_DBG2, "suspicious color format: \"%s\"\n", p); - - if (*p == 'H' || *p == 'h') { - ++p; + + if (*p == 'H' || *p == 'h' || *p == '$') { + ++p; + if (*p == '#') ++p; // Correction By Xaweryz; for subs like {c:$#007FFF} result = mystrtou32(&p, 16, &color); } else { result = mystrtou32(&p, 0, &color); Index: libass/ass_render.c =================================================================== --- libass/ass_render.c (wersja 29328) +++ libass/ass_render.c (kopia robocza) @@ -813,11 +813,48 @@ #define skip_to(x) while ((*p != (x)) && (*p != '}') && (*p != 0)) { ++p;} #define skip(x) if (*p == (x)) ++p; else { return p; } - skip_to('\\'); - skip('\\'); + // check if this may be MicroDVD tag - then omit skipping + if( !(*p == 'c' || *p == 'C' || *p == 'y' || *p == 'Y') ) { + skip_to('\\'); + skip('\\'); + } if ((*p == '}') || (*p == 0)) return p; + + // ADDED BY CYRYL + // MicroDVD format + // must have first precedence becouse some things like {c:} can be read as SSA format + // TODO: lower letter for current line, upper for whole sub + if (mystrcmp(&p, "Y:") || mystrcmp(&p, "y:")) { + while(1) { + char tp = *p; + if(tp == 'i') { + render_context.italic = 110; + update_font(); + } + else if(tp == 'b') { + render_context.bold = 200; + update_font(); + } + else if(tp == '}' || tp == 0) { + return p; + } + //else if(tp == 'u') { // SSA doesn't support underline? + // render_context.underline = 200; + // update_font(); + // } + *p++; // don't know why, but it has to be done at end + } + } + else if (mystrcmp(&p, "C:") || mystrcmp(&p, "c:")) { // $ in strtocolor() + uint32_t val; + if (!strtocolor(&p, &val)) + val = render_context.style->PrimaryColour; + change_color(&render_context.c[0], val, pwr); + } + // END MicroDVD + else // New tags introduced in vsfilter 2.39 if (mystrcmp(&p, "xbord")) { double val; @@ -1255,8 +1292,13 @@ continue; } else break; - } else if (*p != '\\') + } else if (*p != '\\') { mp_msg(MSGT_ASS, MSGL_V, "Unable to parse: \"%s\" \n", p); + --p; // so, if its not a tag, treat this as a string + chr = utf8_get_char(&p); + *str = p; + return chr; + } if (*p == 0) break; } @@ -1926,6 +1968,22 @@ if (code == 0) break; + + // ADDED BY CYRYL ( cyrylas @ gmail .com) + // when / or * at begining of line, set style to bold or italic + if(previous == 0 || previous == '\n') { + if(code == '/') { + render_context.italic = 110; + update_font(); + code = get_next_char(&p); + } else if(code == '*') { + render_context.bold = 200; + update_font(); + code = get_next_char(&p); + } + } + // END ADDED BY CYRYL + if (text_info.length >= MAX_GLYPHS) { mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_MAX_GLYPHS_Reached,