]> git.sesse.net Git - vlc/blobdiff - modules/codec/subsdec.c
mediacodec: don't try OMX.google.*
[vlc] / modules / codec / subsdec.c
index 357fbf91defafffd28ae2af0c555d871a314bc7b..1b4276e299a2a6668047231d29ac705ae93076ba 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$
@@ -32,6 +32,7 @@
 #endif
 
 #include <limits.h>
+#include <errno.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -163,13 +164,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 +180,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 )
@@ -308,7 +309,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     {
         p_sys->iconv_handle = vlc_iconv_open ("UTF-8", encoding);
         if (p_sys->iconv_handle == (vlc_iconv_t)(-1))
-            msg_Err (p_dec, "cannot convert from %s: %m", encoding);
+            msg_Err (p_dec, "cannot convert from %s: %s", encoding,
+                     vlc_strerror_c(errno));
     }
     free (var);
 
@@ -662,14 +664,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 ] );