OSDN Git Service

x264 bump to r1339-82b80ef
[handbrake-jp/handbrake-jp-git.git] / libhb / deccc608sub.c
index 5cfe238..2f13749 100644 (file)
@@ -16,7 +16,7 @@ static int nofontcolor = 0;
 static enum encoding_type encoding = ENC_UTF_8;
 static int cc_channel = 1;
 static enum output_format write_format = OF_SRT;
-static int sentence_cap = 1;
+static int sentence_cap = 0;
 static int subs_delay = 0;
 static LLONG screens_to_process = -1;
 static int processed_enough = 0;
@@ -535,6 +535,8 @@ void get_char_in_unicode (unsigned char *buffer, unsigned char c)
 
 int get_char_in_utf_8 (unsigned char *buffer, unsigned char c) // Returns number of bytes used
 {
+    if (c==0x00)
+        return 0;
     if (c<0x80) // Regular line-21 character set, mostly ASCII except these exceptions
     {
         switch (c)
@@ -679,7 +681,7 @@ int get_char_in_utf_8 (unsigned char *buffer, unsigned char c) // Returns number
             *buffer=0x27;                      
             return 1;
         case 0x97: // inverted exclamation mark
-            *buffer=0xc1;
+            *buffer=0xc2;
             *(buffer+1)=0xa1;
             return 2;
         case 0x98: // asterisk
@@ -1635,7 +1637,8 @@ int write_cc_buffer_as_srt (struct eia608_screen *data, struct s_write *wb)
             } else {
                 if (line == 2) {
                     wb->enc_buffer_used += encode_line (wb->enc_buffer+wb->enc_buffer_used,
-                                                        (unsigned char *) " ");
+                                                        (unsigned char *) "\n");
+                    line = 3;
                 } else {
                     wb->enc_buffer_used += encode_line (wb->enc_buffer+wb->enc_buffer_used,
                                                         (unsigned char *) " "); 
@@ -1646,7 +1649,7 @@ int write_cc_buffer_as_srt (struct eia608_screen *data, struct s_write *wb)
     }
     if (wb->enc_buffer_used)
     {
-        hb_buffer_t *buffer = hb_buffer_init( wb->enc_buffer_used + 2 );
+        hb_buffer_t *buffer = hb_buffer_init( wb->enc_buffer_used + 1 );
         buffer->start = ms_start;
         buffer->stop = ms_end;
         memcpy( buffer->data, wb->enc_buffer, wb->enc_buffer_used + 1 );