[vlc-devel] commit: Support for multiple lines in PJS subs. (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue May 13 21:46:37 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue May 13 12:45:12 2008 -0700| [719151d261197f0a865d0afec5f1d273a884f648]

Support for multiple lines in PJS subs.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=719151d261197f0a865d0afec5f1d273a884f648
---

 modules/demux/subtitle.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 717a06e..8ba4e95 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -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;




More information about the vlc-devel mailing list