Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH] Fix MicroDVD color tag




On Sat, Nov 22, 2014 at 6:04 PM, compn <tempn@xxxxxxxxx> wrote:

> On Sat, 22 Nov 2014 15:53:14 +0100
> Michal Wazgird <mplayer@xxxxxxxxx> wrote:
>
> > This is my first patch submission, so sorry for any misbehaviour :)
>
> you forgot to attach it! :)
>

Sorry :)
This time with attachment. And to proper mail :)
Index: sub/subassconvert.c
===================================================================
--- sub/subassconvert.c	(wersja 37325)
+++ sub/subassconvert.c	(kopia robocza)
@@ -340,10 +340,13 @@
             tag.key = tag_char;
             break;
 
-        /* Color */
+        /* Color: {c:$bbggrr} and {c:$#bbggrr}*/
         case 'C':
             tag.persistent = MICRODVD_PERSISTENT_ON;
         case 'c':
+            ++s;
+            if(*s == '#')
+                ++s;
             tag.data1 = strtol(s, &s, 16) & 0x00ffffff;
             if (*s != '}')
                 break;
@@ -514,6 +517,15 @@
     };
     struct microdvd_tag tags[sizeof(MICRODVD_TAGS) - 1] = {{0}};
 
+    /* '/' at beginning of line is often used to indicate italic text */
+    if(*line == '/') {
+        struct microdvd_tag tag = {0};
+        tag.key = 'y';
+        tag.data1 = 1;
+        microdvd_set_tag(tags, tag);
+        ++line;
+    }
+    
     while (*line) {
         line = microdvd_load_tags(tags, line);
         microdvd_open_tags(&new_line, tags);
@@ -525,6 +537,14 @@
             microdvd_close_no_persistent_tags(&new_line, tags);
             append_text(&new_line, "\\N");
             line++;
+            
+            if(*line == '/') {
+                struct microdvd_tag tag = {0};
+                tag.key = 'y';
+                tag.data1 = 1;
+                microdvd_set_tag(tags, tag);
+                ++line;
+            }
         }
     }
     new_line.buf[new_line.len] = 0;
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng