#include <vlc/input.h>
#include "vlc_video.h"
-
-#if (!defined( WIN32 ) || defined(__MINGW32__))
-# include <dirent.h>
-#endif
-
/*****************************************************************************
* Module descriptor
*****************************************************************************/
};
vlc_module_begin();
+ set_shortname( _("Subtitles"));
set_description( _("Text subtitles demux") );
set_capability( "demux2", 0 );
+ set_category( CAT_INPUT );
+ set_subcategory( SUBCAT_INPUT_DEMUX );
add_float( "sub-fps", 0.0, NULL,
N_("Frames per second"),
SUB_FPS_LONGTEXT, VLC_TRUE );
/* Get the FPS */
- p_sys->i_microsecperframe = 40000; /* default to 25 fps */
f_fps = var_CreateGetFloat( p_demux, "sub-fps" );
if( f_fps >= 1.0 )
{
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
}
+ else
+ {
+ p_sys->i_microsecperframe = 0;
+ }
f_fps = var_CreateGetFloat( p_demux, "sub-original-fps" );
if( f_fps >= 1.0 )
if( p_sys->i_subtitle >= p_sys->i_subtitles )
return 0;
- i_maxdate = p_sys->i_next_demux_date;
+ i_maxdate = p_sys->i_next_demux_date - var_GetTime( p_demux->p_parent, "spu-delay" );;
if( i_maxdate <= 0 && p_sys->i_subtitle < p_sys->i_subtitles )
{
/* Should not happen */
int i_stop;
unsigned int i;
+ int i_microsecperframe = 40000; /* default to 25 fps */
+ if( p_sys->i_microsecperframe > 0 )
+ i_microsecperframe = p_sys->i_microsecperframe;
+
p_subtitle->i_start = 0;
p_subtitle->i_stop = 0;
p_subtitle->psz_text = NULL;
}
}
- p_subtitle->i_start = (int64_t)i_start * p_sys->i_microsecperframe;
- p_subtitle->i_stop = (int64_t)i_stop * p_sys->i_microsecperframe;
+ p_subtitle->i_start = (int64_t)i_start * i_microsecperframe;
+ p_subtitle->i_stop = (int64_t)i_stop * i_microsecperframe;
p_subtitle->psz_text = strndup( buffer_text, MAX_LINE );
return( 0 );
}