set_subcategory( SUBCAT_INPUT_DEMUX )
add_float( "sub-fps", 0.0, NULL,
N_("Frames per second"),
- SUB_FPS_LONGTEXT, true );
+ SUB_FPS_LONGTEXT, true )
add_integer( "sub-delay", 0, NULL,
N_("Subtitles delay"),
- SUB_DELAY_LONGTEXT, true );
+ SUB_DELAY_LONGTEXT, true )
add_string( "sub-type", "auto", NULL, N_("Subtitles format"),
- SUB_TYPE_LONGTEXT, true );
- change_string_list( ppsz_sub_type, NULL, NULL );
+ SUB_TYPE_LONGTEXT, true )
+ change_string_list( ppsz_sub_type, NULL, NULL )
set_callbacks( Open, Close )
add_shortcut( "subtitle" )
demux_sys_t *p_sys = p_demux->p_sys;
text_t *txt = &p_sys->txt;
char *psz_text = NULL;
- char psz_end[12]= "", psz_begin[12] = "";
for( ;; )
{
char *psz_temp = strcasestr( s, "<time");
if( psz_temp != NULL )
{
+ char psz_end[12], psz_begin[12];
/* Line has begin and end */
if( ( sscanf( psz_temp,
- "<%*[t|T]ime %*[b|B]egin=\"%[^\"]\" %*[e|E]nd=\"%[^\"]%*[^>]%[^\n\r]",
+ "<%*[t|T]ime %*[b|B]egin=\"%11[^\"]\" %*[e|E]nd=\"%11[^\"]%*[^>]%[^\n\r]",
psz_begin, psz_end, psz_text) != 3 ) &&
/* Line has begin and no end */
( sscanf( psz_temp,
- "<%*[t|T]ime %*[b|B]egin=\"%[^\"]\"%*[^>]%[^\n\r]",
+ "<%*[t|T]ime %*[b|B]egin=\"%11[^\"]\"%*[^>]%[^\n\r]",
psz_begin, psz_text ) != 2) )
/* Line is not recognized */
{
s = TextGetLine( txt );
if( !s )
+ {
+ free( psz_text );
return VLC_EGENERIC;
+ }
if( sscanf( s, "[%d:%d:%d]", &h2, &m2, &s2 ) == 3 )
p_subtitle->i_stop = ( (int64_t)h2 * 3600*1000 +