/*****************************************************************************
* Module descriptor.
*****************************************************************************/
-static char *ppsz_encodings[] = { DEFAULT_NAME, "ASCII", "UTF-8", "",
+static const char *ppsz_encodings[] = { DEFAULT_NAME, "ASCII", "UTF-8", "",
"ISO-8859-1", "CP1252", "MacRoman", "MacIceland","ISO-8859-15", "",
"ISO-8859-2", "CP1250", "MacCentralEurope", "MacCroatian", "MacRomania", "",
"ISO-8859-5", "CP1251", "MacCyrillic", "MacUkraine", "KOI8-R", "KOI8-U", "KOI8-RU", "",
"HZ", "GBK", "GB18030", "JOHAB", "ARMSCII-8",
"Georgian-Academy", "Georgian-PS", "TIS-620", "MuleLao-1", "VISCII", "TCVN",
"HPROMAN8", "NEXTSTEP" };
+/*
+SSA supports charset selection.
+The following known charsets are used:
+
+0 = Ansi - Western European
+1 = default
+2 = symbol
+3 = invalid
+77 = Mac
+128 = Japanese (Shift JIS)
+129 = Hangul
+130 = Johab
+134 = GB2312 Simplified Chinese
+136 = Big5 Traditional Chinese
+161 = Greek
+162 = Turkish
+163 = Vietnamese
+177 = Hebrew
+178 = Arabic
+186 = Baltic
+204 = Russian (Cyrillic)
+222 = Thai
+238 = Eastern European
+254 = PC 437
+*/
static int pi_justification[] = { 0, 1, 2 };
-static char *ppsz_justification_text[] = {N_("Center"),N_("Left"),N_("Right")};
+static const char *ppsz_justification_text[] = {N_("Center"),N_("Left"),N_("Right")};
#define ENCODING_TEXT N_("Subtitles text encoding")
#define ENCODING_LONGTEXT N_("Set the encoding used in text subtitles")
if( p_dec->fmt_in.subs.psz_encoding && *p_dec->fmt_in.subs.psz_encoding )
{
- msg_Dbg( p_dec, "using character encoding: %s",
+ msg_Dbg( p_dec, "using demux suggested character encoding: %s",
p_dec->fmt_in.subs.psz_encoding );
if( strcmp( p_dec->fmt_in.subs.psz_encoding, "UTF-8" ) )
p_sys->iconv_handle = vlc_iconv_open( "UTF-8", p_dec->fmt_in.subs.psz_encoding );
"subsdec-autodetect-utf8" );
p_sys->iconv_handle = vlc_iconv_open( "UTF-8", psz_charset );
- msg_Dbg( p_dec, "using default character encoding: %s", psz_charset );
+ msg_Dbg( p_dec, "using fallback character encoding: %s", psz_charset );
}
else if( !strcmp( val.psz_string, "UTF-8" ) )
{
- msg_Dbg( p_dec, "using character encoding: UTF-8" );
+ msg_Dbg( p_dec, "using enforced character encoding: UTF-8" );
}
else if( val.psz_string )
{
- msg_Dbg( p_dec, "using character encoding: %s", val.psz_string );
+ msg_Dbg( p_dec, "using enforced character encoding: %s", val.psz_string );
p_sys->iconv_handle = vlc_iconv_open( "UTF-8", val.psz_string );
if( p_sys->iconv_handle == (vlc_iconv_t)-1 )
{
}
/* Check validity of packet data */
- if( p_block->i_buffer <= 1 || p_block->p_buffer[0] == '\0' )
+ /* An "empty" line containing only \0 can be used to force
+ and ephemer picture from the screen */
+ if( p_block->i_buffer < 1 )
{
- msg_Warn( p_dec, "empty subtitle" );
+ msg_Warn( p_dec, "no subtitle data" );
return NULL;
}
{
if( IsUTF8( psz_subtitle ) == NULL )
{
- msg_Dbg( p_dec, "Invalid UTF-8 sequence: "
+ msg_Dbg( p_dec, "invalid UTF-8 sequence: "
"disabling UTF-8 subtitles autodetection" );
p_sys->b_autodetect_utf8 = VLC_FALSE;
}
if( ( ret == (size_t)(-1) ) || inbytes_left )
{
free( psz_new_subtitle );
- msg_Err( p_dec, _("Failed to convert subtitle encoding.\n"
+ msg_Err( p_dec, _("failed to convert subtitle encoding.\n"
"Try manually setting a character-encoding "
"before you open the file.") );
return NULL;
return NULL;
}
+ p_spu->b_pausable = VLC_TRUE;
+
/* Create a new subpicture region */
memset( &fmt, 0, sizeof(video_format_t) );
fmt.i_chroma = VLC_FOURCC('T','E','X','T');