[vlc-devel] commit: Added support for \N \n and \h in subtitles. (Laurent Aimar )

git version control git at videolan.org
Wed Jan 13 19:29:10 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jan 11 21:36:43 2010 +0100| [5fd8aa306ebd4ebaf6a8678d4dd8c6dcd79d31d9] | committer: Laurent Aimar 

Added support for \N \n and \h in subtitles.

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

 modules/codec/subtitles/subsdec.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/modules/codec/subtitles/subsdec.c b/modules/codec/subtitles/subsdec.c
index 9d32434..80b2562 100644
--- a/modules/codec/subtitles/subsdec.c
+++ b/modules/codec/subtitles/subsdec.c
@@ -955,6 +955,25 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
             /* Hide {Y:stupidity} */
             psz_subtitle = strchr( psz_subtitle, '}' ) + 1;
         }
+        else if( psz_subtitle[0] == '\\' && psz_subtitle[1] )
+        {
+            if( psz_subtitle[1] == 'N' || psz_subtitle[1] == 'n' )
+            {
+                HtmlPut( &psz_html, "<br/>" );
+                psz_subtitle += 2;
+            }
+            else if( psz_subtitle[1] == 'h' )
+            {
+                /* Non breakable space */
+                HtmlPut( &psz_html, NO_BREAKING_SPACE );
+                psz_subtitle += 2;
+            }
+            else
+            {
+                HtmlPut( &psz_html, "\\" );
+                psz_subtitle++;
+            }
+        }
         else
         {
             *psz_html = *psz_subtitle;




More information about the vlc-devel mailing list