]> git.sesse.net Git - vlc/commitdiff
Support for multiple lines in PJS subs.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 May 2008 19:45:12 +0000 (12:45 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 13 May 2008 19:45:12 +0000 (12:45 -0700)
modules/demux/subtitle.c

index 717a06e6eb199c5bc4cd43e225ca5212984edad6..8ba4e95154395e28cb63b349821b27b9f98db140 100644 (file)
@@ -1353,6 +1353,7 @@ static int ParsePJS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
     demux_sys_t *p_sys = p_demux->p_sys;
     text_t      *txt = &p_sys->txt;
     char *psz_text;
+    int i;
 
     for( ;; )
     {
@@ -1379,6 +1380,14 @@ static int ParsePJS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
         }
         free( psz_text );
     }
+
+    /* replace | by \n */
+    for( i = 0; psz_text[i] != '\0'; i++ )
+    {
+        if( psz_text[i] == '|' )
+            psz_text[i] = '\n';
+    }
+
     p_subtitle->psz_text = psz_text;
     msg_Dbg( p_demux, "%s", psz_text );
     return VLC_SUCCESS;