Hello,<br><br>Following a stupid move by a fansub group, namely using subtitle comments in order to break VLC, to prevent people from using what they call a 'broken player', I tried to make those works :<br><br>---
subsdec.c 2007-02-03 15:32:39.000000000 +0100<br>+++ subsdec-modif.c 2007-02-03 15:39:19.000000000 +0100<br>@@ -487,16 +487,19 @@<br> i_text++;<br> psz_buffer_sub += 2;<br> }<br>- else if( psz_buffer_sub[0] == '{' &&
<br>- psz_buffer_sub[1] == '\\' )<br>+ else if( psz_buffer_sub[1] == '{' &&<br>+ psz_buffer_sub[0] != '\\' )<br> {<br>- /* SSA control code */
<br>- while( psz_buffer_sub[0] != '\0' &&<br>- psz_buffer_sub[0] != '}' )<br>+ /* We don't need to show SSA comments, so we strip them */<br>+ psz_new_subtitle[i_text] = psz_buffer_sub[0];
<br>+ psz_buffer_sub++;<br>+ while( psz_buffer_sub[1] != '\0' &&<br>+ (psz_buffer_sub[1] != '}' ||<br>+ psz_buffer_sub[0] == '\\' ))
<br> {<br> psz_buffer_sub++;<br> }<br>- psz_buffer_sub++;<br>+ psz_buffer_sub+=2;<br> }<br> else<br> {<br><br>It seems that the previous coder got confused between \{ and {\, thus not striping the comments from the subtitle.
<br>Please check this code, as I am far from being a C pro, and as this was my first time looking into VLC source.<br>Still, it seems to be working : I tested it on the previously non-working movie, and on various snippets.
<br><br>However, I still have a question : I believe SSA subtitles are the same, whether they come inside an mvk or as an independant file. But there's 2 functions with exactly the same role, one in subsdec.c, the other in
subtitle.c, and they doesn't share the same code, which means the bug will remain when the SSA is loaded from a file. <span class="postbody">
It's quite confusing, even for admins (the file j-b pointed me to was for external subs, it took me some time to notice it ).<br><br>Gwenolé LE PACHE<br></span>