Index: libass/ass_utils.c
===================================================================
--- libass/ass_utils.c	(wersja 33504)
+++ libass/ass_utils.c	(kopia robocza)
@@ -82,13 +82,16 @@
     char *p = *q;
     int base = hex ? 16 : 10;
 
-    if (*p == '&')
-        ++p;
-    else
-        ass_msg(library, MSGL_DBG2, "suspicious color format: \"%s\"\n", p);
+    while(*p <= 0x20) {
+      ass_msg(library, MSGL_DBG2, "suspicious color format: \"%s\"\n", p);
+      ++p;
+    }
 
-    if (*p == 'H' || *p == 'h') {
+    if (*p == '&') ++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, base, &color);
Index: libass/ass_parse.c
===================================================================
--- libass/ass_parse.c	(wersja 33504)
+++ libass/ass_parse.c	(kopia robocza)
@@ -246,11 +246,50 @@
  */
 static char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr)
 {
-    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_priv->state.italic = 110;
+          update_font(render_priv);
+        }
+        else if(tp == 'b') {
+          render_priv->state.bold = 200;
+          update_font(render_priv);
+        }
+        else if(tp == 'u') { // SSA doesn't support underline?
+         render_priv->state.flags |= DECO_UNDERLINE;
+         update_font(render_priv);
+        }
+        else if(tp == '}' || tp == 0) {
+          return p;
+        }
+        *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;
+			int hex = render_priv->track->track_type == TRACK_TYPE_ASS;
+      if (!strtocolor(render_priv->library, &p, &val, hex))
+        val = render_priv->state.style->PrimaryColour;
+      change_color(&render_priv->state.c[0], val, pwr);
+    }
+    // END MicroDVD
+    else
     // New tags introduced in vsfilter 2.39
     if (mystrcmp(&p, "xbord")) {
         double val;
@@ -885,9 +924,15 @@
                     continue;
                 } else
                     break;
-            } else if (*p != '\\')
+            } else if (*p != '\\') {
                 ass_msg(render_priv->library, MSGL_V,
                         "Unable to parse: '%.30s'", p);
+                --p; // so, if its not a tag, treat this as a string
+                chr = ass_utf8_get_char((char **) &p);
+                *str = p;
+                return chr;
+            }
+                
             if (*p == 0)
                 break;
         }
@@ -897,7 +942,7 @@
         *str = p;
         return ' ';
     }
-    if (*p == '\\') {
+    else if (*p == '\\') {
         if ((p[1] == 'N') || ((p[1] == 'n') &&
                               (render_priv->state.wrap_style == 2))) {
             p += 2;
Index: libass/ass_render.c
===================================================================
--- libass/ass_render.c	(wersja 33504)
+++ libass/ass_render.c	(kopia robocza)
@@ -1797,6 +1797,23 @@
         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_priv->state.italic = 110;
+            update_font(render_priv);
+            code = get_next_char(render_priv, &p);
+          } else if(code == '*') {
+            render_priv->state.italic = 200;
+            update_font(render_priv);
+            code = get_next_char(render_priv, &p);
+          }
+        }
+        // END ADDED BY CYRYL
+
         if (text_info->length >= text_info->max_glyphs) {
             // Raise maximum number of glyphs
             text_info->max_glyphs *= 2;
