]> git.sesse.net Git - vlc/blobdiff - modules/codec/subsdec.c
skins2: simplify equalizer initialization
[vlc] / modules / codec / subsdec.c
index a6c2382f49164bbc15eba2a20b7a82041ff8081e..a9929b573baf89ab67ba8c1da5d94cbb0c3d1daf 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * subsdec.c : text subtitles decoder
+ * subsdec.c : text subtitle decoder
  *****************************************************************************
  * Copyright (C) 2000-2006 VLC authors and VideoLAN
  * $Id$
@@ -163,13 +163,13 @@ static const int  pi_justification[] = { 0, 1, 2 };
 static const char *const ppsz_justification_text[] = {
     N_("Center"),N_("Left"),N_("Right")};
 
-#define ENCODING_TEXT N_("Subtitles text encoding")
+#define ENCODING_TEXT N_("Subtitle text encoding")
 #define ENCODING_LONGTEXT N_("Set the encoding used in text subtitles")
-#define ALIGN_TEXT N_("Subtitles justification")
+#define ALIGN_TEXT N_("Subtitle justification")
 #define ALIGN_LONGTEXT N_("Set the justification of subtitles")
-#define AUTODETECT_UTF8_TEXT N_("UTF-8 subtitles autodetection")
+#define AUTODETECT_UTF8_TEXT N_("UTF-8 subtitle autodetection")
 #define AUTODETECT_UTF8_LONGTEXT N_("This enables automatic detection of " \
-            "UTF-8 encoding within subtitles files.")
+            "UTF-8 encoding within subtitle files.")
 #define FORMAT_TEXT N_("Formatted Subtitles")
 #define FORMAT_LONGTEXT N_("Some subtitle formats allow for text formatting. " \
  "VLC partly implements this, but you can choose to disable all formatting.")
@@ -179,7 +179,7 @@ static void CloseDecoder  ( vlc_object_t * );
 
 vlc_module_begin ()
     set_shortname( N_("Subtitles"))
-    set_description( N_("Text subtitles decoder") )
+    set_description( N_("Text subtitle decoder") )
     set_capability( "decoder", 50 )
     set_callbacks( OpenDecoder, CloseDecoder )
     set_category( CAT_INPUT )
@@ -662,14 +662,14 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
                 HtmlCopy( &psz_html, &psz_subtitle, "<font " );
                 HtmlPut( &psz_tag, "f" );
 
-                /* <font       color= */
-                while (*psz_subtitle == ' ')
-                    psz_subtitle++;
-
                 while( *psz_subtitle != '>' )
                 {
                     int  k;
 
+                    /* <font       color= */
+                    while (*psz_subtitle == ' ')
+                        psz_subtitle++;
+
                     for( k=0; psz_attribs[ k ]; k++ )
                     {
                         int i_len = strlen( psz_attribs[ k ] );
@@ -735,7 +735,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
             {
                 bool   b_match     = false;
                 bool   b_ignore    = false;
-                int    i_len       = strlen( psz_tag ) - 1;
+                int    i_len       = (psz_tag ? strlen(psz_tag) : 0) - 1;
                 char  *psz_lastTag = NULL;
 
                 if( i_len >= 0 )
@@ -954,7 +954,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
         }
     }
 
-    while( *psz_tag )
+    while( psz_tag && *psz_tag )
     {
         /* */
         char *psz_last = &psz_tag[strlen(psz_tag)-1];