[vlc-devel] [PATCH] Ignore comments in subtitles

Michael Meeuwisse mickeymeeuw at gmail.com
Sun Sep 14 17:11:56 CEST 2008


Hi,

This is an old problem: http://forum.videolan.org/viewtopic.php? 
t=31824 - but the proposed patches either never ended up in VLC, or  
the problem was reintroduced at some point. A lot of code seems to  
have changed so the latter is certainly a possibility. This patch  
should fix it again, however I can't get VLC to compile atm on Leopard  
(3rd party libs refuse to compile) so it's currently untested.

HtH,


Michael

diff --git a/modules/codec/subtitles/subsass.c b/modules/codec/ 
subtitles/subsass.c
index 3725002..4921980 100644
--- a/modules/codec/subtitles/subsass.c
+++ b/modules/codec/subtitles/subsass.c
@@ -93,16 +93,24 @@ void ParseSSAString( decoder_t *p_dec,
              i_text++;
              psz_buffer_sub += 2;
          }
-        else if( psz_buffer_sub[0] == '{' &&
-                 psz_buffer_sub[1] == '\\' )
+        else if( psz_buffer_sub[1] == '{' )
          {
-            /* SSA control code */
-            while( psz_buffer_sub[0] != '\0' &&
-                   psz_buffer_sub[0] != '}' )
+            if(psz_buffer_sub[0] == '\\' )
              {
+                /* SSA control code */
+                while( psz_buffer_sub[0] != '\0' &&
+                      psz_buffer_sub[0] != '}' )
+                {
+                    psz_buffer_sub++;
+                }
                  psz_buffer_sub++;
              }
-            psz_buffer_sub++;
+            else
+            {
+                psz_new_subtitle[i_text] = '{';
+                i_text++;
+                psz_buffer_sub += 2;
+            }
          }
          else
          {




More information about the vlc-devel mailing list