X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Ffake.c;h=b97c208a60ec93112f0171fcb2cf5d821b719b2d;hb=56facae87c28cccca988fa75b104a5bd5ec1da47;hp=f9a92f89ed438a10aa61a18cd3594ac939c228a8;hpb=91b593071ea5b61c5982021354680c49226f099f;p=vlc diff --git a/modules/access/fake.c b/modules/access/fake.c index f9a92f89ed..b97c208a60 100644 --- a/modules/access/fake.c +++ b/modules/access/fake.c @@ -24,11 +24,13 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include #include #include @@ -55,17 +57,17 @@ static void Close( vlc_object_t * ); "end-of-file (default is 0, meaning that the stream is unlimited).") vlc_module_begin(); - set_shortname( _("Fake") ); - set_description( _("Fake input") ); + set_shortname( N_("Fake") ); + set_description( N_("Fake input") ); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_ACCESS ); add_integer( "fake-caching", DEFAULT_PTS_DELAY / 1000, NULL, - CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE ); - add_float( "fake-fps", 25.0, NULL, FPS_TEXT, FPS_LONGTEXT, VLC_TRUE ); - add_integer( "fake-id", 0, NULL, ID_TEXT, ID_LONGTEXT, VLC_TRUE ); + CACHING_TEXT, CACHING_LONGTEXT, true ); + add_float( "fake-fps", 25.0, NULL, FPS_TEXT, FPS_LONGTEXT, true ); + add_integer( "fake-id", 0, NULL, ID_TEXT, ID_LONGTEXT, true ); add_integer( "fake-duration", 0, NULL, DURATION_TEXT, DURATION_LONGTEXT, - VLC_TRUE ); + true ); add_shortcut( "fake" ); set_capability( "access_demux", 0 ); @@ -100,12 +102,13 @@ static int Open( vlc_object_t *p_this ) return VLC_EGENERIC; /* Set up p_demux */ - STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys; + DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys; p_demux->info.i_update = 0; p_demux->info.i_title = 0; p_demux->info.i_seekpoint = 0; - p_sys->i_duration = var_CreateGetInteger( p_demux, "fake-duration" ) * 1000; + p_sys->i_duration = + (mtime_t)var_CreateGetInteger( p_demux, "fake-duration" ) * 1000; p_sys->f_fps = var_CreateGetFloat( p_demux, "fake-fps" ); /* Declare the elementary stream */ @@ -136,7 +139,7 @@ static void Close( vlc_object_t *p_this ) static int Control( demux_t *p_demux, int i_query, va_list args ) { demux_sys_t *p_sys = p_demux->p_sys; - vlc_bool_t *pb, b; + bool *pb, b; int64_t *pi64, i64; double *pf, f; @@ -144,13 +147,14 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { /* Special for access_demux */ case DEMUX_CAN_PAUSE: + case DEMUX_CAN_SEEK: case DEMUX_CAN_CONTROL_PACE: - pb = (vlc_bool_t *)va_arg( args, vlc_bool_t * ); - *pb = VLC_TRUE; + pb = (bool *)va_arg( args, bool * ); + *pb = true; return VLC_SUCCESS; case DEMUX_SET_PAUSE_STATE: - b = (vlc_bool_t)va_arg( args, vlc_bool_t ); + b = (bool)va_arg( args, int ); if ( b ) { p_sys->i_pause_pts = mdate();