/*****************************************************************************
- * subsdec.c : text subtitles decoder
+ * subsdec.c : text subtitle decoder
*****************************************************************************
* Copyright (C) 2000-2006 VLC authors and VideoLAN
* $Id$
#endif
#include <limits.h>
+#include <errno.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
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.")
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 )
{
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);
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 ] );