Index: libass/ass_utils.c
===================================================================
--- libass/ass_utils.c	(wersja 27468)
+++ libass/ass_utils.c	(kopia robocza)
@@ -59,11 +59,15 @@
 	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') { 
+  if (*p == 'H' || *p == 'h' || *p == '$') { 
 		++p;
 		result = mystrtou32(&p, 16, &color);
 	} else {
Index: libass/ass_render.c
===================================================================
--- libass/ass_render.c	(wersja 27468)
+++ libass/ass_render.c	(kopia robocza)
@@ -683,12 +683,47 @@
 #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;
 
-	if (mystrcmp(&p, "fsc")) {
+  
+  // 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 if (mystrcmp(&p, "fsc")) {
 		char tp = *p++;
 		double val;
 		if (tp == 'x') {
@@ -1065,8 +1100,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;
 		}
@@ -1771,6 +1811,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, 
